├── docs ├── public │ ├── .nojekyll │ ├── CORS │ ├── .gitignore │ ├── images │ │ ├── V.jpg │ │ ├── web.png │ │ ├── CRMEB.png │ │ ├── bit-l.png │ │ ├── mele.png │ │ ├── qrcode.png │ │ ├── renren.png │ │ ├── vform.png │ │ ├── CRMEB-l.png │ │ ├── baidayun.png │ │ ├── cloud-1.png │ │ ├── cloud-2.png │ │ ├── compo-1.png │ │ ├── compo-2.png │ │ ├── compo-3.png │ │ ├── figure-1.png │ │ ├── figure-2.png │ │ ├── frsimple.png │ │ ├── jeeplus.png │ │ ├── jnpfsoft.png │ │ ├── plant-1.png │ │ ├── plant-2.png │ │ ├── buildadmin.png │ │ ├── formmaking.png │ │ ├── frsimple-l.png │ │ ├── hamburger.png │ │ ├── jnpf_index.png │ │ ├── js-design.png │ │ ├── mele-banner.png │ │ ├── theme-intro.png │ │ ├── typography.png │ │ ├── baidayun-logo.png │ │ ├── buildadmin-l.png │ │ ├── element-demo.jpeg │ │ ├── intro-theme-b.png │ │ ├── misboot-left.png │ │ ├── misboot-logo.png │ │ ├── vform-banner.png │ │ ├── fantastic-admin.png │ │ ├── jeeplus_banner.jpg │ │ ├── js-design-banner.jpg │ │ ├── theme-index-blue.png │ │ ├── fantastic-admin-l.png │ │ ├── sponsors │ │ │ └── figure-2.png │ │ ├── element-plus-og-image.png │ │ ├── theme-index-blue-dark.png │ │ ├── typography │ │ │ ├── term-arial.png │ │ │ ├── line-height.png │ │ │ ├── term-arial-dark.png │ │ │ ├── term-helvetica.png │ │ │ ├── term-hiragino.png │ │ │ ├── term-microsoft.png │ │ │ ├── term-pingfang.png │ │ │ ├── line-height-dark.png │ │ │ ├── term-helvetica-dark.png │ │ │ ├── term-hiragino-dark.png │ │ │ ├── term-microsoft-dark.png │ │ │ └── term-pingfang-dark.png │ │ └── element-plus-logo-small.svg │ ├── vercel.json │ └── sw.js ├── stub │ └── types__react │ │ └── index.d.ts ├── .vitepress │ ├── i18n │ │ ├── lang.json │ │ ├── component │ │ │ ├── api-typing.json │ │ │ ├── skip-link.json │ │ │ ├── last-update-at.json │ │ │ ├── overview.json │ │ │ ├── navbar.json │ │ │ ├── translation.json │ │ │ ├── icons.json │ │ │ ├── edit-link.json │ │ │ ├── changelog.json │ │ │ ├── footer.json │ │ │ ├── sponsor.json │ │ │ ├── pwa.json │ │ │ ├── demo-block.json │ │ │ └── anchor.json │ │ └── pages │ │ │ ├── not-found.json │ │ │ └── sidebar.json │ ├── config │ │ ├── features.ts │ │ ├── analytics.ts │ │ ├── vue-compiler.ts │ │ ├── nav.ts │ │ └── plugins.ts │ ├── utils │ │ ├── types.ts │ │ └── lang.ts │ ├── env.d.ts │ ├── vitepress │ │ ├── styles │ │ │ ├── common │ │ │ │ ├── index.scss │ │ │ │ ├── helper.scss │ │ │ │ └── hamburger.scss │ │ │ ├── nav │ │ │ │ └── menu.scss │ │ │ ├── content │ │ │ │ ├── hero-content.scss │ │ │ │ ├── doc-content.scss │ │ │ │ └── tag-content.scss │ │ │ ├── app.scss │ │ │ ├── overlay.scss │ │ │ ├── vars.scss │ │ │ ├── subnav.scss │ │ │ ├── scrollbar.scss │ │ │ ├── mixins.scss │ │ │ └── content.scss │ │ ├── types.ts │ │ ├── components │ │ │ ├── dev │ │ │ │ ├── deprecated-tag.vue │ │ │ │ ├── version-tag.vue │ │ │ │ └── a11y-tag.vue │ │ │ ├── globals │ │ │ │ ├── vp-api-bool.vue │ │ │ │ ├── vp-api-number.vue │ │ │ │ ├── vp-api-string.vue │ │ │ │ ├── vp-api-primitive.vue │ │ │ │ ├── vp-api-ref.vue │ │ │ │ ├── vp-api-enum.vue │ │ │ │ ├── vp-api-external.vue │ │ │ │ ├── vp-api-function.vue │ │ │ │ ├── main-color.vue │ │ │ │ └── contributors.vue │ │ │ ├── vp-overlay.vue │ │ │ ├── icons │ │ │ │ ├── expand.vue │ │ │ │ ├── dark.vue │ │ │ │ ├── back-to-top.vue │ │ │ │ ├── toggle-button.vue │ │ │ │ ├── element-plus-logo.vue │ │ │ │ ├── playground.vue │ │ │ │ └── light.vue │ │ │ ├── navbar │ │ │ │ ├── vp-menu.vue │ │ │ │ ├── vp-social-links.vue │ │ │ │ ├── vp-hamburger.vue │ │ │ │ ├── vp-theme-toggler.vue │ │ │ │ └── vp-social-link.vue │ │ │ ├── vp-doc-content.vue │ │ │ ├── full-screen │ │ │ │ ├── vp-menu.vue │ │ │ │ ├── vp-theme-toggler.vue │ │ │ │ └── vp-menu-link.vue │ │ │ ├── vp-hero-content.vue │ │ │ ├── demo │ │ │ │ └── vp-source-code.vue │ │ │ ├── subnav │ │ │ │ └── toggle-sidebar-btn.vue │ │ │ ├── doc-content │ │ │ │ ├── vp-page-footer.vue │ │ │ │ └── vp-edit-link.vue │ │ │ ├── overview-icons │ │ │ │ ├── ov-color.vue │ │ │ │ ├── ov-link.vue │ │ │ │ └── ov-skeleton.vue │ │ │ ├── vp-not-found.vue │ │ │ ├── common │ │ │ │ ├── vp-link.vue │ │ │ │ └── vp-markdown.vue │ │ │ ├── sponsors │ │ │ │ └── sponsors-button.vue │ │ │ ├── vp-sponsors.vue │ │ │ ├── vp-nav.vue │ │ │ ├── vp-subnav.vue │ │ │ ├── vp-sidebar.vue │ │ │ └── vp-content.vue │ │ ├── composables │ │ │ ├── dark.ts │ │ │ ├── fullscreen.ts │ │ │ ├── locale.ts │ │ │ ├── nav.ts │ │ │ ├── navbar-locale.ts │ │ │ ├── social-links.ts │ │ │ ├── lang.ts │ │ │ ├── toggle-widgets.ts │ │ │ ├── source-code.ts │ │ │ ├── feature-flag.ts │ │ │ ├── useDynamicClass.ts │ │ │ └── use-toc.ts │ │ └── constant.ts │ ├── plugins │ │ ├── table-wrapper.ts │ │ ├── headers.ts │ │ ├── tooltip.ts │ │ ├── tag.ts │ │ └── api-table.ts │ └── theme │ │ ├── demo.scss │ │ └── index.ts ├── .gitignore ├── en-US │ ├── resource │ │ └── index.md │ ├── index.md │ └── guide │ │ ├── dev-faq.md │ │ ├── changelog.md │ │ ├── dev-guide.md │ │ └── translation.md ├── zh-CN │ ├── resource │ │ └── index.md │ ├── index.md │ ├── guide │ │ ├── dev-guide.md │ │ ├── changelog.md │ │ └── translation.md │ └── component │ │ └── config-provider.md ├── index.md ├── examples │ └── .eslintrc.json ├── unocss.config.ts └── tsconfig.json ├── .coveralls.yml ├── .husky └── pre-commit ├── packages ├── utils │ ├── index.ts │ ├── private │ │ ├── create.ts │ │ ├── throttle.ts │ │ ├── key-composition.ts │ │ ├── selection.ts │ │ ├── global-nodes.ts │ │ ├── render.ts │ │ └── format.ts │ ├── package.json │ ├── objects.ts │ └── platform.ts ├── theme-default │ ├── .gitignore │ ├── tsconfig.json │ ├── src │ │ ├── echart-overlay.scss │ │ ├── fonts │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ └── iconfont.woff2 │ │ ├── images │ │ │ ├── vc-tilt-sm.png │ │ │ ├── vc-tiltbar-sm.png │ │ │ ├── vc-zoombar-sm.png │ │ │ ├── vc-zoomin-sm.png │ │ │ ├── vc-zoomout-sm.png │ │ │ ├── vc-arrows-e-sm.png │ │ │ ├── vc-arrows-n-sm.png │ │ │ ├── vc-arrows-s-sm.png │ │ │ ├── vc-arrows-w-sm.png │ │ │ ├── vc-zoom-control-sm.png │ │ │ ├── vc-compass-arrows-sm.png │ │ │ ├── vc-compass-outer-ring-sm.png │ │ │ ├── vc-compass-outer-ring-active-sm.png │ │ │ └── vc-compass-rotation-marker.svg │ │ ├── selection-indicator.scss │ │ ├── html-overlay.scss │ │ ├── drawings.scss │ │ ├── print.scss │ │ ├── core │ │ │ ├── touch.scss │ │ │ ├── mixins.scss │ │ │ ├── ripple.scss │ │ │ └── mouse.scss │ │ ├── my-location.scss │ │ ├── navigation.scss │ │ ├── measurements.scss │ │ ├── compass.scss │ │ ├── zoom-control.scss │ │ ├── tooltip.scss │ │ ├── distance-legend.scss │ │ ├── ajax-bar.scss │ │ ├── helpers │ │ │ └── string.scss │ │ ├── status-bar.scss │ │ ├── index.scss │ │ └── spinner.scss │ ├── .postcssrc.js │ ├── README.md │ └── package.json ├── shared │ ├── widgets │ │ └── index.ts │ ├── src │ │ ├── DrawStatus.ts │ │ └── index.ts │ ├── analyses │ │ └── index.ts │ ├── extends │ │ ├── core │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── scene │ │ │ └── index.ts │ │ └── materials │ │ │ ├── VcBaseMaterialProperty.ts │ │ │ └── index.ts │ ├── index.ts │ ├── package.json │ └── shaders │ │ └── materials │ │ ├── VcLineTrailMaterial.ts │ │ ├── VcCircleScanMaterial.ts │ │ ├── VcRadarLineMaterial.ts │ │ ├── VcLineFlickerMaterial.ts │ │ ├── VcEllipsoidWaveMaterial.ts │ │ ├── index.ts │ │ ├── VcLineFlowColorMaterial.ts │ │ ├── VcRectSlideMaterial.ts │ │ ├── VcLineBloomMaterial.ts │ │ ├── VcScanLineMaterial.ts │ │ ├── VcLineTrailColorMaterial.ts │ │ └── VcCircleWaveMaterial.ts ├── vue-cesium │ ├── defaults.ts │ ├── index.ts │ ├── all.ts │ └── package.json ├── locale │ ├── tsconfig.json │ ├── package.json │ └── __test__ │ │ └── locale.spec.ts ├── components │ ├── providers │ │ ├── baidu │ │ │ ├── Projection.ts │ │ │ ├── Pixel.ts │ │ │ └── Point.ts │ │ └── tianditu │ │ │ └── TiandituMapsStyle.ts │ ├── overlays │ │ └── wind │ │ │ ├── glsl │ │ │ ├── segmentDraw.frag.ts │ │ │ ├── fullscreen.vert.ts │ │ │ ├── screenDraw.frag.ts │ │ │ └── updatePosition.frag.ts │ │ │ └── grid │ │ │ └── consts.ts │ ├── config-provider │ │ └── index.ts │ ├── ui │ │ ├── spinner │ │ │ ├── use-spinner.ts │ │ │ └── spinner.ts │ │ └── fab │ │ │ ├── defaultPropsAction.ts │ │ │ └── defaultProps.ts │ ├── package.json │ ├── entity │ │ └── index.ts │ ├── post-processes │ │ └── post-process-stage │ │ │ └── defaultProps.ts │ ├── measurements │ │ └── index.ts │ ├── imagery-layer │ │ └── index.ts │ ├── controls │ │ ├── status-bar │ │ │ └── prettifyProjection.ts │ │ └── distance-legend │ │ │ └── defaultProps.ts │ ├── viewer │ │ └── index.ts │ ├── geometry-instance │ │ └── index.ts │ ├── index.ts │ ├── drawings │ │ └── index.ts │ └── analyses │ │ └── index.ts ├── composables │ ├── private │ │ ├── use-dark.ts │ │ ├── use-timeout.ts │ │ ├── use-size.ts │ │ ├── use-tick.ts │ │ ├── use-align.ts │ │ ├── use-transition.ts │ │ ├── use-vc-extension.ts │ │ └── use-form.ts │ ├── use-vue-cesium-extend │ │ └── index.ts │ ├── package.json │ ├── index.ts │ └── use-geometries │ │ └── index.ts └── directives │ ├── index.ts │ └── package.json ├── .github ├── .git_commit_template.txt ├── ISSUE_TEMPLATE │ └── config.yml ├── ISSUE_TEMPLATE.md ├── pull_request_template.md ├── FUNDING.yml ├── CONTRIBUTING.zh-CN.md └── workflows │ └── unit-test.yml ├── .npmrc ├── lint-staged.config.mjs ├── .gitattributes ├── pnpm-workspace.yaml ├── internal ├── build │ ├── tsconfig.json │ ├── utils │ │ ├── fs.ts │ │ ├── repo.ts │ │ ├── constants.ts │ │ ├── gulp.ts │ │ └── process.ts │ ├── index.ts │ ├── build.config.ts │ ├── plugins │ │ ├── size-reporter.ts │ │ └── alias.ts │ ├── package.json │ └── gen-version.ts └── metadata │ ├── package.json │ └── src │ └── components.ts ├── .editorconfig ├── .gitignore ├── typings └── vue-shim.d.ts ├── scripts └── publish.sh ├── .sasslintrc ├── tsconfig.json └── LICENSE /docs/public/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/CORS: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /docs/stub/types__react/index.d.ts: -------------------------------------------------------------------------------- 1 | export {} 2 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/lang.json: -------------------------------------------------------------------------------- 1 | ["en-US", "zh-CN"] 2 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: OJU5evSawxjYVXpHw94qzTjiw2AvwOLIH -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | npx lint-staged 3 | -------------------------------------------------------------------------------- /packages/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * as logger from './logger' 2 | -------------------------------------------------------------------------------- /docs/.vitepress/config/features.ts: -------------------------------------------------------------------------------- 1 | export const features = {} 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | public/llms.txt 2 | public/llms-full.txt 3 | temp 4 | -------------------------------------------------------------------------------- /docs/.vitepress/utils/types.ts: -------------------------------------------------------------------------------- 1 | export const define = (value: T): T => value 2 | -------------------------------------------------------------------------------- /docs/public/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | docs 3 | node_modules 4 | packages 5 | play 6 | -------------------------------------------------------------------------------- /packages/theme-default/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | lib 4 | npm-debug* 5 | -------------------------------------------------------------------------------- /docs/.vitepress/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | export {} 4 | -------------------------------------------------------------------------------- /docs/en-US/resource/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | page: true 3 | lang: en-US 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/zh-CN/resource/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | page: true 3 | lang: zh-CN 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/public/images/V.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/V.jpg -------------------------------------------------------------------------------- /docs/public/images/web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/web.png -------------------------------------------------------------------------------- /docs/public/images/CRMEB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/CRMEB.png -------------------------------------------------------------------------------- /docs/public/images/bit-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/bit-l.png -------------------------------------------------------------------------------- /docs/public/images/mele.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/mele.png -------------------------------------------------------------------------------- /docs/public/images/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/qrcode.png -------------------------------------------------------------------------------- /docs/public/images/renren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/renren.png -------------------------------------------------------------------------------- /docs/public/images/vform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/vform.png -------------------------------------------------------------------------------- /packages/shared/widgets/index.ts: -------------------------------------------------------------------------------- 1 | import VcTimeline from './Timeline' 2 | 3 | export { 4 | VcTimeline 5 | } 6 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/common/index.scss: -------------------------------------------------------------------------------- 1 | @use './switch'; 2 | @use './hamburger'; 3 | @use './helper'; 4 | -------------------------------------------------------------------------------- /docs/public/images/CRMEB-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/CRMEB-l.png -------------------------------------------------------------------------------- /docs/public/images/baidayun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/baidayun.png -------------------------------------------------------------------------------- /docs/public/images/cloud-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/cloud-1.png -------------------------------------------------------------------------------- /docs/public/images/cloud-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/cloud-2.png -------------------------------------------------------------------------------- /docs/public/images/compo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/compo-1.png -------------------------------------------------------------------------------- /docs/public/images/compo-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/compo-2.png -------------------------------------------------------------------------------- /docs/public/images/compo-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/compo-3.png -------------------------------------------------------------------------------- /docs/public/images/figure-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/figure-1.png -------------------------------------------------------------------------------- /docs/public/images/figure-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/figure-2.png -------------------------------------------------------------------------------- /docs/public/images/frsimple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/frsimple.png -------------------------------------------------------------------------------- /docs/public/images/jeeplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/jeeplus.png -------------------------------------------------------------------------------- /docs/public/images/jnpfsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/jnpfsoft.png -------------------------------------------------------------------------------- /docs/public/images/plant-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/plant-1.png -------------------------------------------------------------------------------- /docs/public/images/plant-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/plant-2.png -------------------------------------------------------------------------------- /docs/public/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://openapi.vercel.sh/vercel.json", 3 | "cleanUrls": true 4 | } 5 | -------------------------------------------------------------------------------- /packages/shared/src/DrawStatus.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | BeforeDraw: 0, 3 | Drawing: 1, 4 | AfterDraw: 2 5 | } 6 | -------------------------------------------------------------------------------- /packages/theme-default/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/public/images/buildadmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/buildadmin.png -------------------------------------------------------------------------------- /docs/public/images/formmaking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/formmaking.png -------------------------------------------------------------------------------- /docs/public/images/frsimple-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/frsimple-l.png -------------------------------------------------------------------------------- /docs/public/images/hamburger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/hamburger.png -------------------------------------------------------------------------------- /docs/public/images/jnpf_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/jnpf_index.png -------------------------------------------------------------------------------- /docs/public/images/js-design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/js-design.png -------------------------------------------------------------------------------- /docs/public/images/mele-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/mele-banner.png -------------------------------------------------------------------------------- /docs/public/images/theme-intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/theme-intro.png -------------------------------------------------------------------------------- /docs/public/images/typography.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography.png -------------------------------------------------------------------------------- /docs/public/images/baidayun-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/baidayun-logo.png -------------------------------------------------------------------------------- /docs/public/images/buildadmin-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/buildadmin-l.png -------------------------------------------------------------------------------- /docs/public/images/element-demo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/element-demo.jpeg -------------------------------------------------------------------------------- /docs/public/images/intro-theme-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/intro-theme-b.png -------------------------------------------------------------------------------- /docs/public/images/misboot-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/misboot-left.png -------------------------------------------------------------------------------- /docs/public/images/misboot-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/misboot-logo.png -------------------------------------------------------------------------------- /docs/public/images/vform-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/vform-banner.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'A Vue 3 based component library.' 3 | lang: en-US 4 | page: true 5 | --- 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/public/images/fantastic-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/fantastic-admin.png -------------------------------------------------------------------------------- /docs/public/images/jeeplus_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/jeeplus_banner.jpg -------------------------------------------------------------------------------- /docs/public/images/js-design-banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/js-design-banner.jpg -------------------------------------------------------------------------------- /docs/public/images/theme-index-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/theme-index-blue.png -------------------------------------------------------------------------------- /.github/.git_commit_template.txt: -------------------------------------------------------------------------------- 1 | # [TYPE](SCOPE):DESCRIPTION#[ISSUE] 2 | # example feat(button):add type 'button' for form usage #1234 3 | -------------------------------------------------------------------------------- /docs/public/images/fantastic-admin-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/fantastic-admin-l.png -------------------------------------------------------------------------------- /docs/public/images/sponsors/figure-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/sponsors/figure-2.png -------------------------------------------------------------------------------- /docs/public/images/element-plus-og-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/element-plus-og-image.png -------------------------------------------------------------------------------- /docs/public/images/theme-index-blue-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/theme-index-blue-dark.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-arial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-arial.png -------------------------------------------------------------------------------- /packages/theme-default/src/echart-overlay.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | .vc-echart-container { 3 | z-index: $z-side; 4 | } 5 | -------------------------------------------------------------------------------- /docs/public/images/typography/line-height.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/line-height.png -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/fonts/iconfont.ttf -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/fonts/iconfont.woff -------------------------------------------------------------------------------- /docs/public/images/typography/term-arial-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-arial-dark.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-helvetica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-helvetica.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-hiragino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-hiragino.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-microsoft.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-pingfang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-pingfang.png -------------------------------------------------------------------------------- /packages/theme-default/src/fonts/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/fonts/iconfont.woff2 -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-tilt-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-tilt-sm.png -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/types.ts: -------------------------------------------------------------------------------- 1 | export interface Link { 2 | text: string 3 | link: string 4 | promotion?: string 5 | activeMatch: string 6 | } 7 | -------------------------------------------------------------------------------- /docs/public/images/typography/line-height-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/line-height-dark.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-tiltbar-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-tiltbar-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-zoombar-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-zoombar-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-zoomin-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-zoomin-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-zoomout-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-zoomout-sm.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-helvetica-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-helvetica-dark.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-hiragino-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-hiragino-dark.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-microsoft-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-microsoft-dark.png -------------------------------------------------------------------------------- /docs/public/images/typography/term-pingfang-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/docs/public/images/typography/term-pingfang-dark.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-arrows-e-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-arrows-e-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-arrows-n-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-arrows-n-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-arrows-s-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-arrows-s-sm.png -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-arrows-w-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-arrows-w-sm.png -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/api-typing.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "detail": "Type details" 4 | }, 5 | "zh-CN": { 6 | "detail": "类型详情" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/skip-link.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "title": "Skip to content" 4 | }, 5 | "zh-CN": { 6 | "title": "跳转到内容" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/zh-CN/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 一个 Vue3 地图组件库 3 | page: true 4 | lang: zh-CN 5 | --- 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-zoom-control-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-zoom-control-sm.png -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/last-update-at.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "title": "Last Updated" 4 | }, 5 | "zh-CN": { 6 | "title": "最后更新" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-compass-arrows-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-compass-arrows-sm.png -------------------------------------------------------------------------------- /docs/examples/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-console": "off", 4 | "no-unused-vars": "off", 5 | "@typescript-eslint/no-unused-vars": "off" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/vue-cesium/defaults.ts: -------------------------------------------------------------------------------- 1 | import Components from './component' 2 | import makeInstaller from './make-installer' 3 | 4 | export default makeInstaller([...Components]) 5 | -------------------------------------------------------------------------------- /docs/en-US/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: A Vue 3 based component library 3 | page: true 4 | lang: en-US 5 | --- 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-compass-outer-ring-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-compass-outer-ring-sm.png -------------------------------------------------------------------------------- /docs/en-US/guide/dev-faq.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Development FAQ 3 | lang: en-US 4 | --- 5 | 6 | # Development FAQ 7 | 8 | Here are the problems that are easy to encounter in development. 9 | -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-compass-outer-ring-active-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zouyaoji/vue-cesium/HEAD/packages/theme-default/src/images/vc-compass-outer-ring-active-sm.png -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/overview.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "empty-description": "Oops! There's nothing~" 4 | }, 5 | "zh-CN": { 6 | "empty-description": "哎呀!什么都没有~" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist = true 2 | strict-peer-dependencies=false 3 | shell-emulator=true 4 | # electron_mirror = https://npmmirror.com/mirrors/electron/ 5 | # registry=https://registry.npmmirror.com/ 6 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/dev/deprecated-tag.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/nav/menu.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins' as *; 2 | 3 | .navbar-menu { 4 | display: none; 5 | 6 | @include respond-to('md') { 7 | display: flex; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lint-staged.config.mjs: -------------------------------------------------------------------------------- 1 | // lint-staged.config.js 2 | export default { 3 | 'packages/**/*.{ts,vue,js,tsx,jsx}': ['eslint --fix'], 4 | 'packages/**/*.{json,md,css,scss,less,html}': ['eslint --fix'] 5 | } 6 | -------------------------------------------------------------------------------- /packages/theme-default/src/selection-indicator.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-selection-indicator { 4 | pointer-events: none; 5 | position: absolute; 6 | z-index: $z-side; 7 | } 8 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/content/hero-content.scss: -------------------------------------------------------------------------------- 1 | .hero-content { 2 | padding: 40px 40px 0; 3 | } 4 | @media (max-width: 768px) { 5 | .hero-content { 6 | padding: 30px 10px 0; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.ts linguist-detectable=false 3 | *.css linguist-detectable=false 4 | *.scss linguist-detectable=false 5 | *.js linguist-detectable=true 6 | *.vue linguist-detectable=true 7 | -------------------------------------------------------------------------------- /packages/theme-default/src/html-overlay.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | .vc-html-container { 3 | display: none; 4 | position: absolute; 5 | // pointer-events: none; 6 | z-index: $z-side; 7 | } 8 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-bool.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-number.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-string.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/app.scss: -------------------------------------------------------------------------------- 1 | @use './common'; 2 | @use './base'; 3 | @use './code'; 4 | @use './navbar'; 5 | @use './scrollbar'; 6 | @use './subnav'; 7 | @use './overlay'; 8 | @use './sidebar'; 9 | @use './content'; 10 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/dark.ts: -------------------------------------------------------------------------------- 1 | import { useDark, useToggle } from '@vueuse/core' 2 | 3 | export const isDark = useDark({ 4 | storageKey: 'vitepress-theme-appearance' 5 | }) 6 | 7 | export const toggleDark = useToggle(isDark) 8 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - packages/* 3 | - demo 4 | - docs 5 | - internal/* 6 | - '!**/__tests__/**' 7 | onlyBuiltDependencies: 8 | - '@parcel/watcher' 9 | - esbuild 10 | - unrs-resolver 11 | - vue-demi 12 | -------------------------------------------------------------------------------- /packages/theme-default/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | plugins: { 5 | 'postcss-import': {}, 6 | 'postcss-url': { 7 | url: 'inline' 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/locale/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "rootDir": ".", 5 | "declaration": false, 6 | "target": "ES6", 7 | "moduleResolution": "node", 8 | "skipLibCheck": true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "mobile-nav": "mobile navigation", 4 | "theme-toggler": "toggle dark mode" 5 | }, 6 | "zh-CN": { 7 | "mobile-nav": "移动端导航", 8 | "theme-toggler": "切换到暗色主题" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/translation.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "help": "Help Translate 😉", 4 | "language": "Choose the language that you want" 5 | }, 6 | "zh-CN": { 7 | "help": "帮助翻译 😉", 8 | "language": "请选择您的语言" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/constant.ts: -------------------------------------------------------------------------------- 1 | export const defaultLang = 'zh-CN' 2 | 3 | export const PREFERRED_LANG_KEY = 'preferred_lang' 4 | 5 | export const breakpoints = { 6 | sm: 480, 7 | md: 768, 8 | lg: 960, 9 | xlg: 1280, 10 | xxl: 1440 11 | } 12 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/overlay.scss: -------------------------------------------------------------------------------- 1 | .overlay { 2 | position: fixed; 3 | top: 0; 4 | right: 0; 5 | bottom: 0; 6 | left: 0; 7 | background: rgba(0, 0, 0, 0.6); 8 | transition: opacity 0.5s; 9 | z-index: var(--overlay-z-index); 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-overlay.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /internal/build/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "target": "ESNext", 7 | "lib": ["ESNext"] 8 | }, 9 | "include": ["**/*.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/theme-default/src/drawings.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | // 绘制组件 4 | .vc-drawings-container { 5 | position: absolute; 6 | z-index: $z-fab; 7 | // .vc-drawing-button .active { 8 | // opacity: 0.7 !important; 9 | // } 10 | } 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Create new issue 4 | url: https://zouyaoji.top/issue-generator 5 | about: The issue which is not created via https://zouyaoji.top/issue-generator will be closed immediately. 6 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/icons.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "copy-success": "Copied!", 4 | "copy-error": "Your browser does not support copy :(" 5 | }, 6 | "zh-CN": { 7 | "copy-success": "已复制!", 8 | "copy-error": "您的浏览器不支持复制 :(" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/dev/version-tag.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/fullscreen.ts: -------------------------------------------------------------------------------- 1 | import { useToggle } from '@vueuse/core' 2 | 3 | export function useFullScreen() { 4 | const [isFullScreen, toggleFullScreen] = useToggle() 5 | return { 6 | isFullScreen, 7 | toggleFullScreen 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/components/providers/baidu/Projection.ts: -------------------------------------------------------------------------------- 1 | class Projection { 2 | lngLatToPoint() { 3 | throw new Error('lngLatToPoint方法未实现') 4 | } 5 | 6 | pointToLngLat() { 7 | throw new Error('pointToLngLat方法未实现') 8 | } 9 | } 10 | 11 | export default Projection 12 | -------------------------------------------------------------------------------- /packages/theme-default/src/print.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-print { 4 | cursor: pointer; 5 | // text-align: center; 6 | z-index: $z-side; 7 | pointer-events: auto; 8 | } 9 | 10 | .vc-navigation .vc-print { 11 | position: relative; 12 | } 13 | -------------------------------------------------------------------------------- /docs/.vitepress/plugins/table-wrapper.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | 3 | export default (md: MarkdownRenderer): void => { 4 | md.renderer.rules.table_open = () => '
' 5 | md.renderer.rules.table_close = () => '
' 6 | } 7 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-primitive.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/locale.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | import { useLang } from './lang' 3 | 4 | export function useLocale(localeJson: Record>) { 5 | const lang = useLang() 6 | return computed(() => localeJson[lang.value]) 7 | } 8 | -------------------------------------------------------------------------------- /docs/public/sw.js: -------------------------------------------------------------------------------- 1 | self.addEventListener('activate', (e) => { 2 | e.waitUntil( 3 | caches.keys().then((t) => { 4 | return Promise.all( 5 | t.map((n) => { 6 | return caches.delete(n) 7 | }) 8 | ) 9 | }) 10 | ) 11 | }) 12 | self.skipWaiting() 13 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/touch.scss: -------------------------------------------------------------------------------- 1 | .vc-touch { 2 | user-select: none; 3 | user-drag: none; 4 | -khtml-user-drag: none; 5 | -webkit-user-drag: none; 6 | } 7 | 8 | .vc-touch-x { 9 | touch-action: pan-x; 10 | } 11 | 12 | .vc-touch-y { 13 | touch-action: pan-y; 14 | } 15 | -------------------------------------------------------------------------------- /packages/theme-default/src/my-location.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-my-location { 4 | cursor: pointer; 5 | // text-align: center; 6 | z-index: $z-side; 7 | pointer-events: auto; 8 | } 9 | 10 | .vc-navigation .vc-my-location { 11 | position: relative; 12 | } 13 | -------------------------------------------------------------------------------- /packages/composables/private/use-dark.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | 3 | export const useDarkProps = { 4 | dark: { 5 | type: Boolean, 6 | default: null 7 | } 8 | } 9 | 10 | export default function (props) { 11 | // return isDark 12 | return computed(() => props.dark) 13 | } 14 | -------------------------------------------------------------------------------- /docs/zh-CN/guide/dev-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 开发指南 3 | lang: zh-CN 4 | --- 5 | 6 | # 开发指南 7 | 8 | ## 启动项目 9 | 10 | 使用命令 11 | 12 | ```shell 13 | pnpm i 14 | ``` 15 | 16 | 将安装该项目所有依赖。 17 | 18 | ## 网站预览 19 | 20 | 使用命令 21 | 22 | ```shell 23 | pnpm docs:dev 24 | ``` 25 | 26 | 该项目将启动网站,网站内你可以预览全部现有组件。 27 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | quote_type = single 11 | 12 | [*.md] 13 | insert_final_newline = false 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/edit-link.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "edit-on-github": "Edit this page on GitHub", 4 | "edit-on-crowdin": "Edit this page on Crowdin" 5 | }, 6 | "zh-CN": { 7 | "edit-on-github": "在 GitHub 上编辑此页面 ", 8 | "edit-on-crowdin": "在 Crowdin 上编辑此页面 " 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/expand.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/components/providers/baidu/Pixel.ts: -------------------------------------------------------------------------------- 1 | class Pixel { 2 | x: number 3 | y: number 4 | constructor(x, y) { 5 | this.x = x || 0 6 | this.y = y || 0 7 | } 8 | 9 | equals(other) { 10 | return other && other.x === this.x && other.y === this.y 11 | } 12 | } 13 | 14 | export default Pixel 15 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/changelog.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "published-by": "Published by", 4 | "open-link": "Open link", 5 | "select-version": "Select a version" 6 | }, 7 | "zh-CN": { 8 | "published-by": "发布者", 9 | "open-link": "打开链接", 10 | "select-version": "选择版本" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/pages/not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "title": "Resource not found", 4 | "button-title": "Back to Home", 5 | "desc": "The page you requested does not exist" 6 | }, 7 | "zh-CN": { 8 | "title": "找不到资源", 9 | "button-title": "回到首页", 10 | "desc": "请求的页面不存在" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Editor directories and files 2 | .idea 3 | .vscode 4 | 5 | # Package Manager 6 | node_modules 7 | .pnpm-debug.log* 8 | 9 | # System 10 | .DS_Store 11 | 12 | # Bundle 13 | dist 14 | coverage 15 | packages/vue-cesium/version.ts 16 | website-dist 17 | es 18 | lib 19 | 20 | .eslintcache 21 | tmp 22 | docs/.vitepress/cache 23 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/footer.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "source": "Source", 4 | "contributors": "Contributors", 5 | "component": "Component", 6 | "docs": "Docs" 7 | }, 8 | "zh-CN": { 9 | "source": "源代码", 10 | "contributors": "贡献者", 11 | "component": "组件", 12 | "docs": "文档" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/zh-CN/guide/changelog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: '更新日志' 3 | lang: zh-CN 4 | --- 5 | 6 | 11 | 12 | # 更新日志 13 | 14 | 在此页面上,您只能看到我们的 [更新日志](https://github.com/zouyaoji/vue-cesium/blob/dev/CHANGELOG.zh-CN.md) 最新的 30 条记录。 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/.vitepress/config/analytics.ts: -------------------------------------------------------------------------------- 1 | export function sendEvent(action: string, label: string, value?: any, category?: string): void { 2 | const gtag = (window as any).gtag 3 | if (gtag) { 4 | gtag('event', action, { 5 | event_label: label, 6 | event_value: value, 7 | event_category: category 8 | }) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/nav.ts: -------------------------------------------------------------------------------- 1 | import { useData } from 'vitepress' 2 | import { computed } from 'vue' 3 | import { useLang } from './lang' 4 | 5 | export function useNav() { 6 | const { theme } = useData() 7 | const lang = useLang() 8 | 9 | return computed(() => { 10 | return theme.value.nav[lang.value] 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/navbar-locale.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | import navbarLocale from '../../i18n/component/navbar.json' 3 | import { useLang } from './lang' 4 | 5 | export function useNavbarLocale() { 6 | const lang = useLang() 7 | 8 | return computed>(() => navbarLocale[lang.value]) 9 | } 10 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/vars.scss: -------------------------------------------------------------------------------- 1 | // SCSS variables 2 | // breakpoints 3 | $breakpoint-max: 1680px !default; 4 | $breakpoint-xxl: 1440px !default; 5 | $breakpoint-xlg: 1280px !default; 6 | $breakpoint-lg: 960px !default; 7 | $breakpoint-md: 768px !default; 8 | $breakpoint-sm: 480px !default; 9 | 10 | // scrollbar width 11 | $scrollbar-size: 6px; 12 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/social-links.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from 'vue' 2 | 3 | import GitHubIcon from '~icons/ri/github-fill' 4 | 5 | export function useSocialLinks() { 6 | return [ 7 | { 8 | link: 'https://github.com/zouyaoji/vue-cesium', 9 | icon: GitHubIcon as Component, 10 | text: 'GitHub' 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/shared/analyses/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-26 14:43:01 4 | * @LastEditTime: 2022-04-26 14:45:33 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\shared\analyses\index.ts 8 | */ 9 | 10 | import Viewshed from './Viewshed' 11 | 12 | export { Viewshed } 13 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/dark.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/sponsor.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "title": "Sponsors", 4 | "sponsoredBy": "Sponsored by", 5 | "platinumSponsor": "Platinum Sponsors", 6 | "goldSponsor": "Gold Sponsors" 7 | }, 8 | "zh-CN": { 9 | "title": "赞助商", 10 | "sponsoredBy": "赞助商", 11 | "platinumSponsor": "白金赞助商", 12 | "goldSponsor": "金牌赞助商" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/theme-default/README.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | # vue-cesium-theme-default 11 | 12 | > fork from element component chalk theme. 13 | -------------------------------------------------------------------------------- /docs/.vitepress/config/vue-compiler.ts: -------------------------------------------------------------------------------- 1 | // TODO: delete this file after upgrading vue in root package.json 2 | import { createRequire } from 'node:module' 3 | 4 | const _require = createRequire(import.meta.url) 5 | const vitepressPath = _require.resolve('vitepress') 6 | 7 | export const vueCompiler = _require( 8 | _require.resolve('vue/compiler-sfc', { paths: [vitepressPath] }) 9 | ) 10 | -------------------------------------------------------------------------------- /docs/en-US/guide/changelog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Changelog' 3 | lang: en-US 4 | --- 5 | 6 | 11 | 12 | # Changelog 13 | 14 | On this page you can only see the latest 30 records of our [Changelog](https://github.com/zouyaoji/vue-cesium/blob/dev/CHANGELOG.en-US.md). 15 | 16 | 17 | -------------------------------------------------------------------------------- /internal/build/utils/fs.ts: -------------------------------------------------------------------------------- 1 | import { existsSync } from 'fs' 2 | import { mkdir, writeFile } from 'fs/promises' 3 | 4 | export const writeJson = (path: string, data: any, spaces = 0) => 5 | writeFile(path, JSON.stringify(data, undefined, spaces), 'utf-8') 6 | 7 | export const ensureDir = async (path: string) => { 8 | if (!existsSync(path)) await mkdir(path, { recursive: true }) 9 | } 10 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin transition($transition...) { 2 | -moz-transition: $transition; 3 | -o-transition: $transition; 4 | -webkit-transition: $transition; 5 | transition: $transition; 6 | } 7 | 8 | %clearfix { 9 | clear: both; 10 | 11 | &:before, 12 | &:after { 13 | content: ' '; 14 | display: table; 15 | clear: both; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/navbar/vp-menu.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /packages/shared/extends/core/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-15 14:55:19 4 | * @LastEditTime: 2022-04-16 20:47:57 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\shared\extends\core\index.ts 8 | */ 9 | 10 | import RectangleExtend from './RectangleExtend' 11 | 12 | export { RectangleExtend } 13 | -------------------------------------------------------------------------------- /packages/shared/extends/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-15 14:57:43 4 | * @LastEditTime: 2023-08-18 01:08:23 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\packages\shared\extends\index.ts 8 | */ 9 | 10 | export * from './core' 11 | export * from './materials' 12 | export * from './scene' 13 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/pwa.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "message": "New content available, click on refresh button to update.", 4 | "refresh": "Refresh", 5 | "always-refresh": "Always Refresh", 6 | "close": "Close" 7 | }, 8 | "zh-CN": { 9 | "message": "有更新的内容,点击刷新按钮以更新。", 10 | "refresh": "刷新", 11 | "always-refresh": "总是刷新", 12 | "close": "关闭" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/.vitepress/utils/lang.ts: -------------------------------------------------------------------------------- 1 | // import fs from 'node:fs' 2 | import path from 'node:path' 3 | import buildPkg from '@vue-cesium/build' 4 | 5 | const { docRoot } = buildPkg 6 | 7 | export const languages = ['en-US', 'zh-CN'] 8 | 9 | export const ensureLang = (lang: string) => `/${lang}` 10 | 11 | export function getLang(id: string) { 12 | return path.relative(docRoot, id).split(path.sep)[0] 13 | } 14 | -------------------------------------------------------------------------------- /docs/zh-CN/guide/translation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Translation 3 | lang: zh-CN 4 | --- 5 | 6 | # 翻译 7 | 8 | ## 文档 9 | 10 | 在本章中,我们将讨论如何帮助翻译 Vue for Cesium 开发文档。 11 | 12 | ### 背景 13 | 14 | 大部分的贡献者也会寻求翻译器来翻译其它自己不熟悉的外语,而翻译器翻译的内容对母语者可能造成误解,并且对贡献者来说也是一件麻烦的事情。 15 | 16 | ### 我怎么才能帮忙贡献翻译的内容? 17 | 18 | 在项目 `docs.vitepress\i18n\lang.json` 文件中增加你的语言,复制 Vue for Cesium 项目的 `docs\en-US` 目录及子文件,并命名为你的语言,然后翻译这些目录的文件。 19 | -------------------------------------------------------------------------------- /packages/shared/extends/scene/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-16 20:46:23 4 | * @LastEditTime: 2022-04-16 20:48:16 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\shared\extends\scene\index.ts 8 | */ 9 | 10 | import ShadowMapShaderExtend from './ShadowMapShaderExtend' 11 | 12 | export { ShadowMapShaderExtend } 13 | -------------------------------------------------------------------------------- /packages/vue-cesium/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-11-10 17:59:25 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-04-29 10:02:47 7 | * @FilePath: \vue-cesium\packages\vue-cesium\index.ts 8 | */ 9 | import * as VueCesiumExport from './all' 10 | 11 | export * from './all' 12 | export default VueCesiumExport 13 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/dev/a11y-tag.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /packages/composables/private/use-timeout.ts: -------------------------------------------------------------------------------- 1 | import { onBeforeUnmount } from 'vue' 2 | 3 | export default function () { 4 | let timer 5 | 6 | onBeforeUnmount(() => { 7 | clearTimeout(timer) 8 | }) 9 | 10 | return { 11 | registerTimeout(fn, delay) { 12 | clearTimeout(timer) 13 | timer = setTimeout(fn, delay) 14 | }, 15 | 16 | removeTimeout() { 17 | clearTimeout(timer) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/shared/index.ts: -------------------------------------------------------------------------------- 1 | export * from './analyses' 2 | export * from './extends' 3 | export * from './extends/materials' 4 | /* 5 | * @Author: zouyaoji@https://github.com/zouyaoji 6 | * @Date: 2021-06-01 18:06:23 7 | * @LastEditTime: 2023-08-18 01:00:28 8 | * @LastEditors: zouyaoji 370681295@qq.com 9 | * @Description: 10 | * @FilePath: \vue-cesium\packages\shared\index.ts 11 | */ 12 | export * from './src' 13 | export * from './widgets' 14 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/back-to-top.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /docs/en-US/guide/dev-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Local Development 3 | lang: en-US 4 | --- 5 | 6 | # Local Development 7 | 8 | ## Bootstrap project 9 | 10 | With command 11 | 12 | ```shell 13 | pnpm i 14 | ``` 15 | 16 | the project will install all dependencies. 17 | 18 | ## Website preview 19 | 20 | With command 21 | 22 | ```shell 23 | pnpm docs:dev 24 | ``` 25 | 26 | the project will launch website for you to preview all existing component. 27 | -------------------------------------------------------------------------------- /internal/build/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-08 16:34:46 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-08 19:14:08 7 | * @FilePath: \vue-cesium\build\index.ts 8 | */ 9 | export * from './utils/paths' 10 | export * from './utils/pkg' 11 | export * from './utils/repo' 12 | export * from './utils/log' 13 | export * from './utils/fs' 14 | -------------------------------------------------------------------------------- /packages/utils/private/create.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-11 22:55:34 4 | * @LastEditTime: 2022-04-11 22:55:34 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\private\create.js 8 | */ 9 | import { defineComponent, markRaw } from 'vue' 10 | 11 | export const createComponent = raw => markRaw(defineComponent(raw)) 12 | export const createDirective = raw => markRaw(raw) 13 | -------------------------------------------------------------------------------- /internal/build/utils/repo.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-08 17:26:51 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-08 17:27:11 7 | * @FilePath: \vue-cesium\build\utils\repo.ts 8 | */ 9 | export const REPO_OWNER = 'vue-cesium' 10 | export const REPO_NAME = 'vue-cesium' 11 | export const REPO_PATH = `${REPO_OWNER}/${REPO_NAME}` 12 | export const REPO_BRANCH = 'dev' 13 | -------------------------------------------------------------------------------- /packages/components/overlays/wind/glsl/segmentDraw.frag.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-28 09:20:11 4 | * @LastEditTime: 2021-10-28 10:02:43 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\overlays\wind\glsl\segmentDraw.frag.ts 8 | */ 9 | const text = ` 10 | void main() { 11 | const vec4 white = vec4(1.0); 12 | out_FragColor = white; 13 | } 14 | ` 15 | export default text 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Please make sure these boxes are checked before submitting your PR, thank you! 2 | 3 | * [ ] Make sure you follow VueCesium's contributing guide [English](https://github.com/zouyaoji/vue-cesium/blob/master/.github/CONTRIBUTING.en-US.md) | ([中文](https://github.com/zouyaoji/vue-cesium/blob/master/.github/CONTRIBUTING.zh-CN.md)). 4 | * [ ] Make sure you are merging your commits to `dev` branch. 5 | * [ ] Add some descriptions and refer to relative issues for your PR. 6 | -------------------------------------------------------------------------------- /packages/theme-default/src/navigation.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | // 导航控件 4 | .vc-navigation { 5 | position: absolute; 6 | z-index: $z-side; 7 | line-height: 1; 8 | pointer-events: none; 9 | .vc-navigation-controls { 10 | display: flex; 11 | flex-direction: column; 12 | justify-content: center; 13 | align-items: center; 14 | 15 | .vc-navigation-control { 16 | margin: 2px 0; 17 | text-align: center; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/composables/private/use-size.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | 3 | export const useSizeDefaults = { 4 | xs: 18, 5 | sm: 24, 6 | md: 32, 7 | lg: 38, 8 | xl: 46 9 | } 10 | 11 | export const useSizeProps = { 12 | size: String 13 | } 14 | 15 | export default function (props, sizes = useSizeDefaults) { 16 | // return sizeStyle 17 | return computed(() => (props.size !== void 0 ? { fontSize: props.size in sizes ? `${sizes[props.size]}px` : props.size } : null)) 18 | } 19 | -------------------------------------------------------------------------------- /typings/vue-shim.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-13 22:43:29 4 | * @LastEditTime: 2022-01-11 15:54:44 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\typings\vue-shim.d.ts 8 | */ 9 | declare module '*.vue' { 10 | import type { DefineComponent } from 'vue' 11 | // eslint-disable-next-line @typescript-eslint/ban-types 12 | const component: DefineComponent<{}, {}, any> 13 | export default component 14 | } 15 | -------------------------------------------------------------------------------- /packages/directives/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-06 09:21:02 4 | * @LastEditTime: 2022-04-12 13:14:11 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\directives\index.ts 8 | */ 9 | export { default as Ripple } from './ripple' 10 | export { default as TouchHold } from './touch-hold' 11 | export { default as TouchPan } from './touch-pan' 12 | export { default as TouchRepeat } from './touch-repeat' 13 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/toggle-button.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /packages/components/config-provider/index.ts: -------------------------------------------------------------------------------- 1 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 2 | import type { App } from 'vue' 3 | import ConfigProvider from './src' 4 | 5 | ConfigProvider.install = (app: App): void => { 6 | app.component(ConfigProvider.name, ConfigProvider) 7 | } 8 | 9 | const _ConfigProvider = ConfigProvider as SFCWithInstall 10 | 11 | export default _ConfigProvider 12 | export const VcConfigProvider = _ConfigProvider 13 | 14 | export * from './src' 15 | -------------------------------------------------------------------------------- /internal/build/build.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-08 17:54:15 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-08 17:54:27 7 | * @FilePath: \vue-cesium\build\build.config.ts 8 | */ 9 | import { defineBuildConfig } from 'unbuild' 10 | 11 | export default defineBuildConfig({ 12 | entries: ['index'], 13 | clean: true, 14 | declaration: true, 15 | rollup: { 16 | emitCJS: true, 17 | }, 18 | }) 19 | -------------------------------------------------------------------------------- /scripts/publish.sh: -------------------------------------------------------------------------------- 1 | ### 2 | # @Author: zouyaoji@https://github.com/zouyaoji 3 | # @Date: 2021-09-16 09:28:13 4 | # @LastEditTime: 2023-02-01 15:48:00 5 | # @LastEditors: zouyaoji 6 | # @Description: 7 | # @FilePath: \vue-cesium@next\scripts\publish.sh 8 | ### 9 | 10 | #!/bin/sh 11 | 12 | set -e 13 | 14 | pnpm i --frozen-lockfile 15 | pnpm update:version 16 | 17 | pnpm build 18 | 19 | cd dist/vue-cesium 20 | npm publish --tag latest --access public --registry ${REGISTRY} 21 | cd - 22 | 23 | echo "✅ Publish completed" 24 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/navbar/vp-social-links.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 20 | -------------------------------------------------------------------------------- /internal/build/utils/constants.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-03 14:11:08 4 | * @LastEditTime: 2024-06-08 11:51:20 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\build\utils\constants.ts 8 | */ 9 | 10 | export const PKG_PREFIX = '@vue-cesium' 11 | export const PKG_NAME = 'vue-cesium' 12 | export const PKG_CAMELCASE_NAME = 'VueCesium' 13 | export const PKG_CAMELCASE_LOCAL_NAME = 'VueCesiumLocale' 14 | export const PKG_BRAND_NAME = 'Vue Cesium' 15 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-ref.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /packages/theme-default/src/measurements.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | // 量算组件 4 | .vc-measurements-container { 5 | position: absolute; 6 | z-index: $z-fab; 7 | // .vc-measure-button .active { 8 | // opacity: 0.7 !important; 9 | // } 10 | } 11 | 12 | .vc-drawtip { 13 | z-index: $z-tooltip; 14 | overflow-y: auto; 15 | overflow-x: hidden; 16 | padding: $tooltip-padding; 17 | 18 | @media (max-width: $breakpoint-xs-max) { 19 | font-size: $tooltip-mobile-fontsize; 20 | padding: $tooltip-mobile-padding; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/components/overlays/wind/glsl/fullscreen.vert.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-28 09:20:11 4 | * @LastEditTime: 2021-10-28 09:32:24 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\overlays\wind\glsl\fullscreen.ts 8 | */ 9 | const text = ` 10 | in vec3 position; 11 | in vec2 st; 12 | 13 | out vec2 textureCoordinate; 14 | 15 | void main() { 16 | textureCoordinate = st; 17 | gl_Position = vec4(position, 1.0); 18 | } 19 | ` 20 | export default text 21 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/lang.ts: -------------------------------------------------------------------------------- 1 | import { useRoute } from 'vitepress' 2 | import { computed } from 'vue' 3 | import { defaultLang } from '../constant' 4 | 5 | export function useLang() { 6 | const route = useRoute() 7 | return computed(() => { 8 | // the first part of the first slash 9 | const path = route.data?.relativePath 10 | let lang: string 11 | 12 | if (path?.includes('/')) { 13 | lang = path.split('/').shift()! || defaultLang 14 | } 15 | else { 16 | lang = defaultLang 17 | } 18 | return lang 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/toggle-widgets.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from 'vue' 2 | import { isClient } from '@vueuse/core' 3 | 4 | import { watch } from 'vue' 5 | 6 | export function useToggleWidgets(watchSource: Ref, handler: (e: Event) => void) { 7 | if (!isClient) 8 | return 9 | 10 | watch( 11 | () => watchSource.value, 12 | (val) => { 13 | if (val) { 14 | window.addEventListener('resize', handler) 15 | } 16 | else { 17 | window.removeEventListener('resize', handler) 18 | } 19 | } 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /packages/theme-default/src/compass.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-compass { 4 | display: flex; 5 | text-align: center; 6 | align-items: center; 7 | justify-content: center; 8 | z-index: $z-side; 9 | pointer-events: auto; 10 | } 11 | 12 | .vc-navigation .vc-compass { 13 | position: relative; 14 | } 15 | 16 | .vc-compass-innerRing { 17 | padding: 4px; 18 | text-align: center; 19 | } 20 | 21 | .vc-compass-rotation-marker .vc-compass-outerRing { 22 | background-repeat: no-repeat; 23 | background-size: contain; 24 | text-align: center; 25 | } 26 | -------------------------------------------------------------------------------- /packages/components/ui/spinner/use-spinner.ts: -------------------------------------------------------------------------------- 1 | import { useSizeDefaults } from '@vue-cesium/composables/private/use-size' 2 | import { computed } from 'vue' 3 | 4 | export const useSpinnerProps = { 5 | size: { 6 | type: [Number, String], 7 | default: '1em' 8 | }, 9 | color: String 10 | } 11 | 12 | export default function useSpinner(props) { 13 | return { 14 | cSize: computed(() => (props.size in useSizeDefaults ? `${useSizeDefaults[props.size]}px` : props.size)), 15 | 16 | classes: computed(() => `vc-spinner${props.color ? ` text-${props.color}` : ''}`) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/theme-default/src/zoom-control.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-zoom-control { 4 | display: flex; 5 | text-align: center; 6 | align-items: center; 7 | justify-content: center; 8 | z-index: $z-side; 9 | pointer-events: auto; 10 | } 11 | 12 | .vc-navigation .vc-zoom-control { 13 | position: relative; 14 | } 15 | 16 | .vc-list { 17 | display: inherit; 18 | flex-direction: inherit; 19 | list-style: none; 20 | padding-left: 0; 21 | margin: 0; 22 | align-items: center; 23 | justify-content: center; 24 | } 25 | 26 | .vc-list li { 27 | flex: 1; 28 | } 29 | -------------------------------------------------------------------------------- /internal/build/utils/gulp.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-03 14:11:08 4 | * @LastEditTime: 2024-02-05 16:42:56 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\build\utils\gulp.ts 8 | */ 9 | import { run } from './process' 10 | import type { TaskFunction } from 'gulp' 11 | 12 | export const withTaskName: any = (name: string, fn: T) => Object.assign(fn, { displayName: name }) 13 | 14 | export const runTask = (name: string) => withTaskName(name, () => run(`pnpm run build ${name}`)) 15 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/source-code.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from 'vue' 2 | import { useData } from 'vitepress' 3 | import { computed } from 'vue' 4 | 5 | import { createGitHubUrl } from '../utils' 6 | 7 | export function useSourceCode(path: Ref) { 8 | const { theme } = useData() 9 | 10 | const demoUrl = computed(() => { 11 | const { 12 | repo, 13 | docsDir = '', 14 | docsBranch = 'dev', 15 | docsRepo = repo 16 | } = theme.value 17 | 18 | return createGitHubUrl(docsRepo, docsDir, docsBranch, path.value) 19 | }) 20 | 21 | return demoUrl 22 | } 23 | -------------------------------------------------------------------------------- /packages/components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/components", 3 | "version": "3.0.2-beta.12", 4 | "description": "all components are settled here", 5 | "license": "MIT", 6 | "bugs": { 7 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 8 | }, 9 | "homepage": "https://zouyaoji.top/vue-cesium", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com:zouyaoji/vue-cesium.git" 13 | }, 14 | "main": "index.js", 15 | "module": "index.js", 16 | "types": "index.d.ts", 17 | "unpkg": "index.js", 18 | "jsdelivr": "index.js", 19 | "sideEffects": false 20 | } 21 | -------------------------------------------------------------------------------- /packages/components/ui/fab/defaultPropsAction.ts: -------------------------------------------------------------------------------- 1 | import { useFabProps } from './use-fab' 2 | 3 | const anchorMap = { 4 | start: 'self-end', 5 | center: 'self-center', 6 | end: 'self-start' 7 | } 8 | const anchorValues = Object.keys(anchorMap) 9 | 10 | const defaultProps = { 11 | ...useFabProps, 12 | 13 | icon: { 14 | type: String, 15 | default: '' 16 | }, 17 | stacked: Boolean, 18 | anchor: { 19 | type: String, 20 | validator: v => anchorValues.includes(v) 21 | }, 22 | 23 | to: [String, Object], 24 | replace: Boolean 25 | } 26 | 27 | export default defaultProps 28 | export { anchorMap } 29 | -------------------------------------------------------------------------------- /packages/locale/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/locale", 3 | "description": "VueCesium locale", 4 | "version": "3.0.2-beta.3", 5 | "main": "index.js", 6 | "module": "index.js", 7 | "unpkg": "index.js", 8 | "jsdelivr": "index.js", 9 | "types": "index.d.ts", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 13 | }, 14 | "homepage": "https://zouyaoji.top/vue-cesium", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com:zouyaoji/vue-cesium.git" 18 | }, 19 | "peerDependencies": { 20 | "vue": "^3.5.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/shared/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/shared", 3 | "description": "VueCesium shared", 4 | "version": "3.0.2-beta.12", 5 | "main": "index.js", 6 | "module": "index.js", 7 | "unpkg": "index.js", 8 | "jsdelivr": "index.js", 9 | "types": "index.d.ts", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 13 | }, 14 | "homepage": "https://zouyaoji.top/vue-cesium", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com:zouyaoji/vue-cesium.git" 18 | }, 19 | "peerDependencies": { 20 | "vue": "^3.5.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/utils", 3 | "version": "3.0.2-beta.12", 4 | "description": "VueCesium utils.", 5 | "main": "index.js", 6 | "module": "index.js", 7 | "unpkg": "index.js", 8 | "jsdelivr": "index.js", 9 | "types": "index.d.ts", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 13 | }, 14 | "homepage": "https://zouyaoji.top/vue-cesium", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com:zouyaoji/vue-cesium.git" 18 | }, 19 | "peerDependencies": { 20 | "vue": "^3.5.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/navbar/vp-hamburger.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | -------------------------------------------------------------------------------- /packages/composables/use-vue-cesium-extend/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-15 17:07:25 4 | * @LastEditTime: 2022-04-16 20:49:02 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\composables\use-vue-cesium-extend\index.ts 8 | */ 9 | 10 | import { RectangleExtend, ShadowMapShaderExtend } from '@vue-cesium/shared' 11 | 12 | const vcExtends = [RectangleExtend, ShadowMapShaderExtend] 13 | 14 | export default function useVcExtend(viewer: Cesium.Viewer) { 15 | vcExtends.forEach((item) => { 16 | item.extend(viewer) 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /packages/directives/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/directives", 3 | "version": "3.0.2-beta.3", 4 | "description": "VueCesium directives", 5 | "main": "index.js", 6 | "module": "index.js", 7 | "unpkg": "index.js", 8 | "jsdelivr": "index.js", 9 | "types": "index.d.ts", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 13 | }, 14 | "homepage": "https://zouyaoji.top/vue-cesium", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com:zouyaoji/vue-cesium.git" 18 | }, 19 | "peerDependencies": { 20 | "vue": "^3.5.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/composables/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/composables", 3 | "description": "VueCesium composables", 4 | "version": "3.0.2-beta.12", 5 | "main": "index.js", 6 | "module": "index.js", 7 | "unpkg": "index.js", 8 | "jsdelivr": "index.js", 9 | "types": "index.d.ts", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 13 | }, 14 | "homepage": "https://zouyaoji.top/vue-cesium", 15 | "repository": { 16 | "type": "git", 17 | "url": "git://github.com:zouyaoji/vue-cesium.git" 18 | }, 19 | "peerDependencies": { 20 | "vue": "^3.5.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-enum.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /packages/components/overlays/wind/grid/consts.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-03-09 15:50:51 4 | * @LastEditTime: 2022-03-09 15:50:53 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\overlays\wind\grid\consts.js 8 | */ 9 | export const π = Math.PI 10 | export const τ = 2 * π 11 | export const DEG = 360 / τ 12 | export const RAD = τ / 360 13 | 14 | export const MILLI = 1 15 | export const SECOND = 1000 * MILLI 16 | export const MINUTE = 60 * SECOND 17 | export const HOUR = 60 * MINUTE 18 | export const DAY = 24 * HOUR 19 | 20 | export const NIL = 7e37 21 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-doc-content.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | -------------------------------------------------------------------------------- /packages/theme-default/src/tooltip.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-tooltip--style { 4 | font-size: $tooltip-fontsize; 5 | color: $tooltip-color; 6 | background: $tooltip-background; 7 | border-radius: $tooltip-border-radius; 8 | text-transform: none; 9 | font-weight: normal; 10 | white-space: pre-line; 11 | } 12 | 13 | .vc-tooltip { 14 | z-index: $z-tooltip; 15 | position: fixed !important; 16 | overflow-y: auto; 17 | overflow-x: hidden; 18 | padding: $tooltip-padding; 19 | 20 | @media (max-width: $breakpoint-xs-max) { 21 | font-size: $tooltip-mobile-fontsize; 22 | padding: $tooltip-mobile-padding; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /internal/build/plugins/size-reporter.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-06 17:43:48 4 | * @LastEditTime: 2022-01-18 10:29:45 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\build\plugins\size-reporter.ts 8 | */ 9 | import { cyan, bold, yellow, green } from 'chalk' 10 | import { command } from '../utils/log' 11 | import type { FileSizeReporter } from 'rollup-plugin-filesize' 12 | 13 | export const reporter: FileSizeReporter = (opt, outputOptions, info) => { 14 | return command(`${cyan(bold(info.fileName))}: bundle size ${yellow(info.bundleSize)} -> minified ${green(info.minSize)}`) 15 | } 16 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-external.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 28 | 29 | 34 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/full-screen/vp-menu.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 17 | 18 | 24 | -------------------------------------------------------------------------------- /packages/components/entity/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:11 4 | * @LastEditTime: 2022-01-18 14:53:04 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\entity\index.ts 8 | */ 9 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 10 | import type { App } from 'vue' 11 | import Entity from './src' 12 | 13 | Entity.install = (app: App): void => { 14 | app.component(Entity.name, Entity) 15 | } 16 | 17 | const _Entity = Entity as SFCWithInstall 18 | 19 | export default _Entity 20 | export const VcEntity = _Entity 21 | 22 | export * from './src' 23 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/subnav.scss: -------------------------------------------------------------------------------- 1 | @use './mixins' as *; 2 | 3 | .sub-nav { 4 | @include with-border; 5 | @include with-bg; 6 | position: sticky; 7 | top: 0; 8 | left: 0; 9 | width: 100%; 10 | display: flex; 11 | padding: 0 32px; 12 | justify-content: space-between; 13 | z-index: var(--sub-nav-z-index); 14 | overflow: hidden; 15 | 16 | @media (max-width: 767px) { 17 | padding: 0 24px; 18 | } 19 | 20 | .go-back-top { 21 | transform: translateY(100%); 22 | opacity: 0; 23 | 24 | &.show { 25 | transform: translateY(0); 26 | opacity: 1; 27 | } 28 | } 29 | 30 | @include respond-to('lg') { 31 | display: none !important; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/en-US/guide/translation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Translation 3 | lang: en-US 4 | --- 5 | 6 | # Translation 7 | 8 | ## Documentation 9 | 10 | In this chapter, we will discuss how to help translating the documentation of Vue for Cesium. 11 | 12 | ### Background 13 | 14 | Most of the contributors use online translator for their non-native languages, sometimes it would be not only inaccurate but also stressful to them. 15 | 16 | ### How do I translate the documentation? 17 | 18 | Add your language in the project's `docs.vitepress\i18n\lang.json` file. Copy the `docs\en-US` directory and its subfiles from the Vue for Cesium project, rename it to your language, and then translate the files in this directory. 19 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-hero-content.vue: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /docs/unocss.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, presetAttributify, presetIcons, presetUno } from 'unocss' 2 | 3 | export default defineConfig({ 4 | presets: [presetUno(), presetAttributify(), presetIcons()], 5 | content: { 6 | pipeline: { 7 | include: [`./**/*`], 8 | exclude: [`./node_modules/**/*`, `./.vitepress/cache/**/*`] 9 | } 10 | }, 11 | theme: { 12 | breakpoints: { 13 | 'sm': '640px', 14 | 'md': '768px', 15 | 'lg': '1024px', 16 | 'xl': '1280px', 17 | '2xl': '1536px', 18 | '3xl': '1920px' 19 | }, 20 | colors: { 21 | primary: { 22 | DEFAULT: '#2563eb', 23 | deep: '#1d4ed8' 24 | } 25 | } 26 | } 27 | }) 28 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/feature-flag.ts: -------------------------------------------------------------------------------- 1 | import type { MaybeRef } from '@vueuse/core' 2 | import { isClient, useBrowserLocation } from '@vueuse/core' 3 | import { useData } from 'vitepress' 4 | 5 | import { computed, unref } from 'vue' 6 | 7 | const location = useBrowserLocation() 8 | 9 | export function useFeatureFlag(flag: MaybeRef) { 10 | const { theme } = useData() 11 | return computed(() => { 12 | const _flag = unref(flag) 13 | 14 | if (isClient) { 15 | const params = new URLSearchParams(location.value.search) 16 | if (params.get(`feature:${_flag}`)) { 17 | return true 18 | } 19 | } 20 | 21 | return theme.value.features[_flag] 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /packages/utils/private/throttle.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-06 09:21:02 4 | * @LastEditTime: 2021-10-02 23:16:17 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\private\throttle.ts 8 | */ 9 | export default function (fn, limit = 250) { 10 | let wait = false 11 | let result 12 | 13 | return function (this /* ...args */) { 14 | if (wait === false) { 15 | wait = true 16 | setTimeout(() => { 17 | wait = false 18 | }, limit) 19 | // eslint-disable-next-line prefer-rest-params 20 | result = fn.apply(this, arguments) 21 | } 22 | 23 | return result 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/theme-default/src/distance-legend.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | @import './core/mixins.scss'; 3 | 4 | .vc-distance-legend { 5 | position: absolute; 6 | z-index: $z-side; 7 | margin-right: 5px; 8 | box-sizing: border-box; 9 | float: left; 10 | padding: 5px 5px; 11 | font-size: 0.7rem; 12 | text-align: center; 13 | line-height: 1; 14 | border: 0; 15 | outline: 0; 16 | font-family: monospace, sans-serif; 17 | max-height: 21px; 18 | margin-top: 5px; 19 | 20 | .vc-bar { 21 | margin: 0 auto; 22 | display: block; 23 | @include transition(all 0.5s ease-in-out); 24 | } 25 | } 26 | 27 | .vc-location-other-controls .vc-distance-legend { 28 | position: relative; 29 | } 30 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/demo/vp-source-code.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 25 | 26 | 32 | -------------------------------------------------------------------------------- /packages/components/post-processes/post-process-stage/defaultProps.ts: -------------------------------------------------------------------------------- 1 | import type { PropType } from 'vue' 2 | import { clearColor, scissorRectangle } from '@vue-cesium/utils/cesium-props' 3 | 4 | const defaultProps = { 5 | fragmentShader: String, 6 | uniforms: Object, 7 | textureScale: { 8 | type: Number, 9 | default: 1.0 10 | }, 11 | forcePowerOfTwo: { 12 | type: Boolean, 13 | default: false 14 | }, 15 | sampleMode: Number as PropType, 16 | pixelFormat: Number as PropType, 17 | pixelDatatype: Number as PropType, 18 | ...clearColor, 19 | ...scissorRectangle, 20 | name: String 21 | } 22 | 23 | export default defaultProps 24 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/subnav/toggle-sidebar-btn.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | 32 | -------------------------------------------------------------------------------- /packages/components/measurements/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:11 4 | * @LastEditTime: 2022-01-18 14:54:42 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\measurements\index.ts 8 | */ 9 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 10 | import type { App } from 'vue' 11 | import Measurements from './src' 12 | 13 | Measurements.install = (app: App): void => { 14 | app.component(Measurements.name, Measurements) 15 | } 16 | 17 | const _Measurements = Measurements as SFCWithInstall 18 | 19 | export default _Measurements 20 | export const VcMeasurements = _Measurements 21 | 22 | export * from './src' 23 | -------------------------------------------------------------------------------- /packages/theme-default/src/ajax-bar.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-loading-bar { 4 | z-index: $z-max; 5 | transition: 6 | transform 0.5s cubic-bezier(0, 0, 0.2, 1), 7 | opacity 0.5s; 8 | background: $red; 9 | 10 | &--top { 11 | left: 0 #{'/* rtl:ignore */'}; 12 | right: 0 #{'/* rtl:ignore */'}; 13 | top: 0; 14 | width: 100%; 15 | } 16 | 17 | &--bottom { 18 | left: 0 #{'/* rtl:ignore */'}; 19 | right: 0 #{'/* rtl:ignore */'}; 20 | bottom: 0; 21 | width: 100%; 22 | } 23 | 24 | &--right { 25 | top: 0; 26 | bottom: 0; 27 | right: 0; 28 | height: 100%; 29 | } 30 | 31 | &--left { 32 | top: 0; 33 | bottom: 0; 34 | left: 0; 35 | height: 100%; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /docs/.vitepress/config/nav.ts: -------------------------------------------------------------------------------- 1 | import { isExternal } from 'vitepress/dist/client/shared' 2 | import navLocale from '../i18n/pages/sidebar.json' 3 | import { ensureLang } from '../utils/lang' 4 | 5 | // Mapping the first sub link to the nav link to avoid 404 error. 6 | 7 | function getNav() { 8 | return Object.fromEntries( 9 | Object.entries(navLocale).map(([lang, locales]) => { 10 | const item: { 11 | link: string 12 | text: string 13 | activeMatch?: string 14 | }[] = Object.values(locales).map(item => ({ 15 | ...item, 16 | link: `${isExternal(item.link) ? '' : ensureLang(lang)}${item.link}` 17 | })) 18 | 19 | return [lang, item] 20 | }) 21 | ) 22 | } 23 | 24 | export const nav = getNav() 25 | -------------------------------------------------------------------------------- /packages/components/imagery-layer/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:11 4 | * @LastEditTime: 2022-01-18 14:54:37 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\imagery-layer\index.ts 8 | */ 9 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 10 | import type { App } from 'vue' 11 | import ImageryLayer from './src' 12 | 13 | ImageryLayer.install = (app: App): void => { 14 | app.component(ImageryLayer.name, ImageryLayer) 15 | } 16 | 17 | const _ImageryLayer = ImageryLayer as SFCWithInstall 18 | 19 | export default _ImageryLayer 20 | export const VcLayerImagery = _ImageryLayer 21 | 22 | export * from './src' 23 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcLineTrailMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-08-17 00:10:56 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-02-29 00:35:07 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcLineTrailMaterial.ts 8 | */ 9 | export default ` 10 | czm_material czm_getMaterial(czm_materialInput materialInput) 11 | { 12 | czm_material material = czm_getDefaultMaterial(materialInput); 13 | vec2 st = materialInput.st; 14 | vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t)); 15 | material.alpha = colorImage.a * color.a; 16 | material.diffuse = (colorImage.rgb+color.rgb)/2.0; 17 | return material; 18 | } 19 | ` 20 | -------------------------------------------------------------------------------- /packages/vue-cesium/all.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-09-16 09:28:13 4 | * @LastEditTime: 2025-03-31 00:18:20 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\packages\vue-cesium\all.ts 8 | */ 9 | import installer from './defaults' 10 | 11 | export { default as makeInstaller } from './make-installer' 12 | export * from '@vue-cesium/components' 13 | export * from '@vue-cesium/composables' 14 | export * from '@vue-cesium/directives' 15 | export * from '@vue-cesium/locale' 16 | export * from '@vue-cesium/shared' 17 | 18 | // type define 19 | export * from '@vue-cesium/utils/emits' 20 | 21 | export const install = installer.install 22 | export const version = installer.version 23 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/doc-content/vp-page-footer.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | 36 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/common/helper.scss: -------------------------------------------------------------------------------- 1 | .bg-transparent { 2 | color: var(--el-text-color-primary); 3 | background-image: 4 | linear-gradient(45deg, #f4f4f5 25%, #f000 25%), linear-gradient(135deg, #f4f4f5 25%, #0000 25%), 5 | linear-gradient(45deg, #0000 75%, #f4f4f5 75%), linear-gradient(135deg, #0000 75%, #f4f4f5 75%); 6 | background-size: 20px 20px; 7 | background-position: 8 | 0px 0px, 9 | 10px 0px, 10 | 10px -10px, 11 | 0px 10px; 12 | } 13 | 14 | .dark { 15 | .bg-transparent { 16 | background-image: 17 | linear-gradient(45deg, #292929 25%, #f000 25%), linear-gradient(135deg, #292929 25%, #0000 25%), 18 | linear-gradient(45deg, #0000 75%, #292929 75%), linear-gradient(135deg, #0000 75%, #292929 75%); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/composables/private/use-tick.ts: -------------------------------------------------------------------------------- 1 | import { nextTick, onBeforeUnmount } from 'vue' 2 | 3 | /* 4 | * Usage: 5 | * registerTick(fn) 6 | * registerTick(fn) 7 | * .... 8 | * prepareTick() 9 | */ 10 | 11 | export default function () { 12 | let tickFn 13 | 14 | onBeforeUnmount(() => { 15 | tickFn = void 0 16 | }) 17 | 18 | return { 19 | registerTick(fn) { 20 | tickFn = fn 21 | }, 22 | 23 | removeTick() { 24 | tickFn = void 0 25 | }, 26 | 27 | prepareTick() { 28 | if (tickFn !== void 0) { 29 | const fn = tickFn 30 | nextTick(() => { 31 | if (tickFn === fn) { 32 | tickFn() 33 | tickFn = void 0 34 | } 35 | }) 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/overview-icons/ov-color.vue: -------------------------------------------------------------------------------- 1 | 33 | -------------------------------------------------------------------------------- /packages/theme-default/src/helpers/string.scss: -------------------------------------------------------------------------------- 1 | @function str-replace($string, $search, $replace: '') { 2 | $index: str-index($string, $search); 3 | 4 | @if $index { 5 | $start: str-slice($string, 1, $index - 1); 6 | $end: str-replace(str-slice($string, $index + str-length($search)), $search, $replace); 7 | 8 | @return $start + $replace + $end; 9 | } 10 | 11 | @return $string; 12 | } 13 | 14 | @function str-fr($selector, $name, $i: '') { 15 | @return str-replace(str-replace($selector, '', $name), '', $i); 16 | } 17 | 18 | @function str-fe($selector, $name, $noProc, $i: '') { 19 | @if $noProc { 20 | @return str-fr($selector, $name, $i); 21 | } 22 | 23 | @return join(str-fr($selector, '', $i), str-fr($selector, $name, $i), $separator: comma); 24 | } 25 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/content/doc-content.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins' as *; 2 | @use './table-of-content'; 3 | 4 | .doc-content-wrapper { 5 | --vp-content-width: 800px; 6 | 7 | padding: 32px 24px; 8 | 9 | .doc-content-container { 10 | .doc-content { 11 | width: 100%; 12 | } 13 | 14 | @include respond-to('xxl') { 15 | min-width: var(--vp-content-width); 16 | width: 100%; 17 | } 18 | } 19 | 20 | @include respond-to('md') { 21 | padding: 48px 32px; 22 | } 23 | @include respond-to('lg') { 24 | padding: 48px 32px; 25 | } 26 | @include respond-to('xxl') { 27 | padding: 64px 0 48px 64px; 28 | display: flex; 29 | } 30 | @include respond-to('max') { 31 | padding: 64px 0 48px 64px; 32 | display: flex; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/components/controls/status-bar/prettifyProjection.ts: -------------------------------------------------------------------------------- 1 | import proj4 from 'proj4' 2 | 3 | /** 4 | * Turns the longitude / latitude in degrees into a human readable pretty UTM zone representation. 5 | */ 6 | function prettifyProjection(longitude, latitude, proj4Projection, proj4longlat, projectionUnits) { 7 | const zone = 1 + Math.floor((longitude + 180) / 6) 8 | 9 | const projection = `${proj4Projection} +zone=${zone}${latitude < 0 ? ' +south' : ''}` 10 | 11 | const projPoint = proj4(proj4longlat, projection, [longitude, latitude]) 12 | 13 | return { 14 | utmZone: zone + (latitude < 0.0 ? 'S' : 'N'), 15 | north: projPoint[1].toFixed(2) + projectionUnits, 16 | east: projPoint[0].toFixed(2) + projectionUnits 17 | } 18 | } 19 | 20 | export default prettifyProjection 21 | -------------------------------------------------------------------------------- /packages/components/viewer/index.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigProviderContext } from '@vue-cesium/utils/config' 2 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 3 | /* 4 | * @Author: zouyaoji@https://github.com/zouyaoji 5 | * @Date: 2021-09-16 09:28:13 6 | * @LastEditTime: 2022-02-10 10:25:17 7 | * @LastEditors: zouyaoji 8 | * @Description: 9 | * @FilePath: \vue-cesium@next\packages\components\viewer\index.ts 10 | */ 11 | import type { App } from 'vue' 12 | import Viewer from './src' 13 | 14 | Viewer.install = (app: App, opts: ConfigProviderContext): void => { 15 | app.component(Viewer.name, Viewer) 16 | } 17 | 18 | const _Viewer = Viewer as SFCWithInstall 19 | 20 | export default _Viewer 21 | export const VcViewer = _Viewer 22 | 23 | export * from './src' 24 | -------------------------------------------------------------------------------- /packages/composables/private/use-align.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | 3 | export const alignMap = { 4 | left: 'start', 5 | center: 'center', 6 | right: 'end', 7 | between: 'between', 8 | around: 'around', 9 | evenly: 'evenly', 10 | stretch: 'stretch' 11 | } 12 | 13 | export const alignValues = Object.keys(alignMap) 14 | 15 | export const useAlignProps = { 16 | align: { 17 | type: String, 18 | validator: v => alignValues.includes(v) 19 | } 20 | } 21 | 22 | export default function (props) { 23 | // return alignClass 24 | return computed(() => { 25 | const align = props.align === void 0 ? (props.vertical === true ? 'stretch' : 'left') : props.align 26 | 27 | return `${props.vertical === true ? 'items' : 'justify'}-${alignMap[align]}` 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /packages/utils/private/key-composition.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-06 09:21:02 4 | * @LastEditTime: 2021-10-02 23:15:01 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\private\key-composition.ts 8 | */ 9 | let lastKeyCompositionStatus = false 10 | 11 | export function onKeyDownComposition(evt) { 12 | lastKeyCompositionStatus = evt.isComposing === true 13 | } 14 | 15 | export function shouldIgnoreKey(evt) { 16 | return lastKeyCompositionStatus === true || evt !== Object(evt) || evt.isComposing === true || evt.qKeyEvent === true 17 | } 18 | 19 | export function isKeyCode(evt, keyCodes) { 20 | return shouldIgnoreKey(evt) === true ? false : ([] as any).concat(keyCodes).includes(evt.keyCode) 21 | } 22 | -------------------------------------------------------------------------------- /packages/components/geometry-instance/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:11 4 | * @LastEditTime: 2022-01-18 14:54:23 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\geometry-instance\index.ts 8 | */ 9 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 10 | import type { App } from 'vue' 11 | import GeometryInstance from './src' 12 | 13 | GeometryInstance.install = (app: App): void => { 14 | app.component(GeometryInstance.name, GeometryInstance) 15 | } 16 | 17 | const _GeometryInstance = GeometryInstance as SFCWithInstall 18 | 19 | export default _GeometryInstance 20 | export const VcGeometryInstance = _GeometryInstance 21 | 22 | export * from './src' 23 | -------------------------------------------------------------------------------- /packages/components/providers/tianditu/TiandituMapsStyle.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:13 4 | * @LastEditTime: 2022-01-15 23:32:46 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\providers\tianditu\TiandituMapsStyle.ts 8 | */ 9 | const TiandituMapsStyle = { 10 | IMG_W: 'img_w', 11 | IMG_C: 'img_c', 12 | CIA_W: 'cia_w', 13 | CIA_C: 'cia_c', 14 | VEC_W: 'vec_w', 15 | VEC_C: 'vec_c', 16 | TER_W: 'ter_w', 17 | TER_C: 'ter_c', 18 | CVA_W: 'cva_w', 19 | CVA_C: 'cva_c', 20 | CTA_W: 'cta_w', 21 | CTA_C: 'cta_c', 22 | EIA_W: 'eia_w', 23 | EIA_C: 'eia_c', 24 | EVA_W: 'eva_w', 25 | EVA_C: 'eva_c', 26 | IBO_C: 'ibo_c', 27 | IBO_W: 'ibo_w' 28 | } 29 | export default TiandituMapsStyle 30 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [zouyaoji] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | custom: ['https://zouyaoji.top/vue-cesium/#/en-US/donations'] 14 | -------------------------------------------------------------------------------- /.sasslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "extends-before-mixins": 2, 4 | "extends-before-declarations": 2, 5 | "placeholder-in-extend": 2, 6 | "mixins-before-declarations": [ 7 | 2, 8 | { 9 | "exclude": [ 10 | "breakpoint", 11 | "mq" 12 | ] 13 | } 14 | ], 15 | "no-warn": 1, 16 | "no-debug": 1, 17 | "no-ids": 0, 18 | "no-important": 0, 19 | "hex-notation": 0, 20 | "indentation": [ 21 | 2, 22 | { 23 | "size": 2 24 | } 25 | ], 26 | "class-name-format": 0, 27 | "no-color-literals": 0, 28 | "empty-line-between-blocks": 0, 29 | "single-line-per-selector": 1, 30 | "force-element-nesting": 0, 31 | "property-sort-order": 0, 32 | "variable-for-property": 0, 33 | "leading-zero": 0 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/doc-content/vp-edit-link.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | 24 | 35 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcCircleScanMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-23 09:42:32 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2025-03-31 00:17:04 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcCircleScanMaterial.ts 8 | */ 9 | export default ` 10 | uniform vec4 color; 11 | uniform sampler2D image; 12 | uniform float globalAlpha; 13 | 14 | czm_material czm_getMaterial(czm_materialInput materialInput) { 15 | czm_material material = czm_getDefaultMaterial(materialInput); 16 | vec2 st = materialInput.st; 17 | vec4 imgVC = texture(image, st); 18 | if (imgVC.a > 0.0) { 19 | material.diffuse = color.rgb; 20 | } 21 | material.alpha = imgVC.a * color.a * globalAlpha; 22 | return material; 23 | } 24 | ` 25 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcRadarLineMaterial.ts: -------------------------------------------------------------------------------- 1 | export default `uniform vec4 color; 2 | uniform float speed; 3 | uniform float globalAlpha; 4 | 5 | czm_material czm_getMaterial(czm_materialInput materialInput) { 6 | czm_material material = czm_getDefaultMaterial(materialInput); 7 | vec2 st = materialInput.st * 2.0 - 1.0; 8 | float t = czm_frameNumber * speed / 1000.0; 9 | vec3 colMars3D = vec3(0.0); 10 | vec2 p = vec2(sin(t), cos(t)); 11 | float d = length(st - dot(p, st) * p); 12 | if(dot(st, p) < 0.0) { 13 | d = length(st); 14 | } 15 | 16 | colMars3D = 0.006 / d * color.rgb; 17 | 18 | if(distance(st, vec2(0.0)) > 0.99) { 19 | colMars3D = color.rgb; 20 | } 21 | 22 | material.alpha = pow(length(colMars3D), 2.0) * globalAlpha; 23 | material.diffuse = colMars3D * 3.0; 24 | return material; 25 | } 26 | ` 27 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "resolveJsonModule": true, 7 | "allowSyntheticDefaultImports": true, 8 | "esModuleInterop": true, 9 | "forceConsistentCasingInFileNames": true, 10 | "strict": true, 11 | "noImplicitAny": false, 12 | "skipLibCheck": true, 13 | "lib": ["ESNext", "DOM", "WebWorker"], 14 | "paths": { 15 | "vue-cesium": ["../packages/vue-cesium"], 16 | "~/*": ["./.vitepress/vitepress/*"], 17 | "vue": ["./node_modules/vue"] 18 | }, 19 | "types": ["unplugin-icons/types/vue", "element-plus/global"], 20 | "jsx": "preserve", 21 | "jsxImportSource": "vue" 22 | }, 23 | "include": ["**/*", ".vitepress/**/*", "../typings/global.d.ts"], 24 | "exclude": ["node_modules"] 25 | } 26 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/scrollbar.scss: -------------------------------------------------------------------------------- 1 | @use './vars' as *; 2 | 3 | // scrollbar 4 | * { 5 | scrollbar-color: var(--el-scrollbar-bg-color) var(--el-fill-color-light); 6 | } 7 | 8 | ::-webkit-scrollbar { 9 | width: $scrollbar-size; 10 | } 11 | 12 | ::-webkit-scrollbar:horizontal { 13 | height: $scrollbar-size; 14 | } 15 | 16 | ::-webkit-scrollbar-track { 17 | border-radius: 10px; 18 | } 19 | 20 | ::-webkit-scrollbar-thumb { 21 | background-color: rgba(0, 0, 0, 0.2); 22 | border-radius: 10px; 23 | transition: all 0.2s ease-in-out; 24 | 25 | &:hover { 26 | cursor: pointer; 27 | background-color: rgba(0, 0, 0, 0.3); 28 | } 29 | } 30 | 31 | .dark { 32 | ::-webkit-scrollbar-thumb { 33 | background-color: rgba(255, 255, 255, 0.2); 34 | &:hover { 35 | background-color: rgba(255, 255, 255, 0.4); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/element-plus-logo.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/mixins.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:map'; 2 | 3 | @use './vars' as *; 4 | 5 | @mixin with-bg { 6 | background-color: var(--bg-color); 7 | color: var(--text-color); 8 | transition: 9 | border-color var(--el-transition-duration), 10 | background-color var(--el-transition-duration-fast); 11 | } 12 | 13 | @mixin with-border { 14 | border-bottom: 1px solid var(--border-color); 15 | } 16 | 17 | $breakpoints: ( 18 | 'sm': #{$breakpoint-sm}, 19 | 'md': #{$breakpoint-md}, 20 | 'lg': #{$breakpoint-lg}, 21 | 'xlg': #{$breakpoint-xlg}, 22 | 'xxl': #{$breakpoint-xxl}, 23 | 'max': #{$breakpoint-max} 24 | ) !default; 25 | 26 | @mixin respond-to($breakpoint) { 27 | @if #{map.has-key($breakpoints, $breakpoint)} { 28 | @media screen and (min-width: #{map.get($breakpoints, $breakpoint)}) { 29 | @content; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /internal/metadata/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/metadata", 3 | "version": "0.0.1", 4 | "description": "Metadata for Vue Cesium", 5 | "keywords": [ 6 | "vue-cesium" 7 | ], 8 | "license": "MIT", 9 | "files": [ 10 | "dist" 11 | ], 12 | "publishConfig": { 13 | "access": "public" 14 | }, 15 | "scripts": { 16 | "build": "run-p \"build:*\"", 17 | "build:contributor": "tsx src/contributor.ts", 18 | "build:components": "tsx src/components.ts", 19 | "dev": "DEV=1 pnpm run build" 20 | }, 21 | "devDependencies": { 22 | "@vue-cesium/build": "workspace:*", 23 | "@types/lodash-es": "^4.17.6", 24 | "chalk": "^5.6.2", 25 | "consola": "^3.4.2", 26 | "fast-glob": "^3.3.3", 27 | "lodash-es": "^4.17.21", 28 | "npm-run-all2": "^8.0.4", 29 | "octokit": "2.1.0", 30 | "tsx": "^4.20.6" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/utils/private/selection.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-06 09:21:02 4 | * @LastEditTime: 2021-10-02 23:16:08 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\private\selection.ts 8 | */ 9 | import { platform } from '../platform' 10 | 11 | export function clearSelection() { 12 | if (window.getSelection !== void 0) { 13 | const selection = window.getSelection() 14 | if (selection?.empty !== void 0) { 15 | selection.empty() 16 | } 17 | else if (selection?.removeAllRanges !== void 0) { 18 | selection.removeAllRanges() 19 | platform().isPhone !== true && selection.addRange(document.createRange()) 20 | } 21 | } 22 | else if ((document as any).selection !== void 0) { 23 | ;(document as any).selection.empty() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-not-found.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 27 | 28 | 34 | -------------------------------------------------------------------------------- /packages/components/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:11 4 | * @LastEditTime: 2021-12-31 11:48:08 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\index.ts 8 | */ 9 | export * from './analyses' 10 | export * from './config-provider' 11 | export * from './controls' 12 | export * from './datasources' 13 | export * from './drawings' 14 | export * from './entity' 15 | export * from './geometries' 16 | export * from './geometry-instance' 17 | export * from './graphics' 18 | export * from './imagery-layer' 19 | export * from './measurements' 20 | export * from './overlays' 21 | export * from './post-processes' 22 | export * from './primitive-collections' 23 | export * from './primitives' 24 | export * from './providers' 25 | export * from './ui' 26 | export * from './viewer' 27 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/ripple.scss: -------------------------------------------------------------------------------- 1 | .vc-ripple { 2 | position: absolute; 3 | top: 0; 4 | left: 0 #{'/* rtl:ignore */'}; 5 | width: 100%; 6 | height: 100%; 7 | color: inherit; 8 | border-radius: inherit; 9 | z-index: 0; 10 | pointer-events: none; 11 | overflow: hidden; 12 | contain: strict; 13 | 14 | &__inner { 15 | position: absolute; 16 | top: 0; 17 | left: 0 #{'/* rtl:ignore */'}; 18 | opacity: 0; 19 | color: inherit; 20 | border-radius: 50%; 21 | background: currentColor; 22 | pointer-events: none; 23 | will-change: transform, opacity; 24 | 25 | &--enter { 26 | transition: 27 | transform 0.225s cubic-bezier(0.4, 0, 0.2, 1), 28 | opacity 0.1s cubic-bezier(0.4, 0, 0.2, 1); 29 | } 30 | 31 | &--leave { 32 | transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/common/vp-link.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 26 | 27 | 37 | -------------------------------------------------------------------------------- /internal/build/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/build", 3 | "version": "0.0.1", 4 | "private": true, 5 | "type": "commonjs", 6 | "description": "Build Toolchain for Vue Cesium", 7 | "license": "MIT", 8 | "main": "./dist/index.cjs", 9 | "module": "./dist/index.mjs", 10 | "types": "./dist/index.d.ts", 11 | "scripts": { 12 | "start": "node --require tsx/cjs node_modules/gulp-cli/bin/gulp -f gulpfile.ts", 13 | "dev": "pnpm run stub", 14 | "stub": "unbuild --stub" 15 | }, 16 | "peerDependencies": { 17 | "vue": "^3.5.0" 18 | }, 19 | "devDependencies": { 20 | "@pnpm/types": "^1001.0.0", 21 | "@vitejs/plugin-vue": "5.2.4", 22 | "@vitejs/plugin-vue-jsx": "4.2.0", 23 | "algoliasearch": "^5.44.0", 24 | "gulp": "^5.0.1", 25 | "gulp-cli": "^3.1.0", 26 | "unbuild": "^3.6.1", 27 | "vue": "^3.5.24", 28 | "tsx": "^4.20.6" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.zh-CN.md: -------------------------------------------------------------------------------- 1 | # VueCesium 贡献指南 2 | 3 | Hi! 首先感谢你使用 VueCesium。 4 | 5 | VueCesium 是一套为 GISer 准备的开源组件库,旨在快速搭建基于 Cesium 的三维 WebGIS 页面。它基于 Vue 3.0 开发,并提供了配套的文档和例子。 6 | 7 | VueCesium 的成长离不开大家的支持,如果你愿意为 VueCesium 贡献代码或提供建议,请阅读以下内容。 8 | 9 | ## Issue 规范 10 | - issue 仅用于提交 Bug 或 Feature 以及设计相关的内容,其它内容可能会被直接关闭。如果你在使用时产生了疑问,请到 QQ 群咨询。 11 | 12 | - 在提交 issue 之前,请搜索相关内容是否已被提出。 13 | 14 | - 请说明 VueCesium 和 Vue 的版本号,并提供操作系统和浏览器信息。推荐使用 [JSFiddle](https://jsfiddle.net/) 生成在线 demo,这能够更直观地重现问题。 15 | 16 | ## Pull Request 规范 17 | - 请先 fork 一份到自己的项目下,不要直接在仓库下建分支。 18 | 19 | - commit 信息要以`[组件名]: 描述信息` 的形式填写,例如 `Button: fix xxx bug`。 20 | 21 | - **不要提交** `lib` 里面打包的文件。 22 | 23 | - 执行 `npm run build` 后可以正确打包文件。 24 | 25 | - 提交 PR 前请 rebase,确保 commit 记录的整洁。 26 | 27 | - 确保 PR 是提交到 `dev` 分支,而不是 `master` 分支。 28 | 29 | - 如果是修复 bug,请在 PR 中给出描述信息。 30 | 31 | - 合并代码需要两名维护人员参与:一人进行 review 后 approve,另一人再次 review,通过后即可合并。 32 | -------------------------------------------------------------------------------- /docs/.vitepress/plugins/headers.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | 3 | import { resolveHeadersFromTokens, slugify } from '@mdit-vue/shared' 4 | 5 | /** 6 | * Get markdown headers info 7 | * 8 | * Extract them into env 9 | */ 10 | export default (md: MarkdownRenderer): void => { 11 | // extract headers to env 12 | const render = md.renderer.render.bind(md.renderer) 13 | 14 | const level = [2, 3, 4, 5, 6] 15 | md.renderer.render = (tokens, options, env) => { 16 | env.headers = resolveHeadersFromTokens(tokens, { 17 | level, 18 | shouldAllowHtml: true, 19 | shouldAllowNested: false, 20 | shouldEscapeText: false, 21 | slugify 22 | }) 23 | // remove space before < 24 | env.headers.forEach((header) => { 25 | header.title = header.title.replace(/\s+ 2 | import { isDark } from '../../composables/dark' 3 | import { useNavbarLocale } from '../../composables/navbar-locale' 4 | import CommonThemeToggler from '../common/vp-theme-toggler.vue' 5 | 6 | const locale = useNavbarLocale() 7 | 8 | 9 | 18 | 19 | 31 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcLineFlickerMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-22 16:45:36 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-22 16:45:49 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcLineFlickerMaterial.ts 8 | */ 9 | export default ` 10 | uniform vec4 color; 11 | uniform float speed; 12 | uniform float globalAlpha; 13 | 14 | czm_material czm_getMaterial(czm_materialInput materialInput) { 15 | czm_material material = czm_getDefaultMaterial(materialInput); 16 | float time = fract(czm_frameNumber * speed / 1000.0); 17 | vec2 st = materialInput.st; 18 | float scalarMars3D = smoothstep(0.0, 1.0, time); 19 | material.diffuse = color.rgb * scalarMars3D; 20 | material.alpha = color.a * scalarMars3D * globalAlpha; 21 | return material; 22 | } 23 | ` 24 | -------------------------------------------------------------------------------- /packages/components/drawings/index.ts: -------------------------------------------------------------------------------- 1 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 2 | /* 3 | * @Author: zouyaoji@https://github.com/zouyaoji 4 | * @Date: 2021-10-27 15:54:11 5 | * @LastEditTime: 2022-03-06 22:50:38 6 | * @LastEditors: zouyaoji 7 | * @Description: 8 | * @FilePath: \vue-cesium@next\packages\components\drawings\index.ts 9 | */ 10 | import type { App } from 'vue' 11 | import Drawings from './src' 12 | 13 | Drawings.install = (app: App): void => { 14 | app.component(Drawings.name, Drawings) 15 | } 16 | 17 | const _Drawings = Drawings as SFCWithInstall 18 | 19 | export default _Drawings 20 | export const VcDrawings = _Drawings 21 | 22 | export * from './src' 23 | export * from './src/pin' 24 | export * from './src/point' 25 | export * from './src/polygon' 26 | export * from './src/polyline' 27 | export * from './src/rectangle' 28 | export * from './src/regular' 29 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcEllipsoidWaveMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-23 16:26:16 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-23 16:26:58 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcEllipsoidWaveMaterial.ts 8 | */ 9 | export default ` 10 | uniform vec4 color; 11 | uniform float speed; 12 | uniform float globalAlpha; 13 | 14 | czm_material czm_getMaterial(czm_materialInput materialInput) { 15 | czm_material material = czm_getDefaultMaterial(materialInput); 16 | vec2 st = materialInput.st; 17 | float time = fract(czm_frameNumber * speed / 1000.0); 18 | float alphaVC = abs(smoothstep(0.5, 1.0, fract(-st.t - time))); 19 | alphaVC += 0.1; 20 | material.alpha = alphaVC * globalAlpha; 21 | material.diffuse = color.rgb; 22 | return material; 23 | } 24 | ` 25 | -------------------------------------------------------------------------------- /docs/.vitepress/config/plugins.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | import mdContainer from 'markdown-it-container' 3 | import { groupIconMdPlugin } from 'vitepress-plugin-group-icons' 4 | import { ApiTableContainer } from '../plugins/api-table' 5 | import createDemoContainer from '../plugins/demo' 6 | import externalLinkIcon from '../plugins/external-link-icon' 7 | import headers from '../plugins/headers' 8 | import tableWrapper from '../plugins/table-wrapper' 9 | import tag from '../plugins/tag' 10 | 11 | import tooltip from '../plugins/tooltip' 12 | 13 | export function mdPlugin(md: MarkdownRenderer) { 14 | md.use(headers) 15 | md.use(externalLinkIcon) 16 | md.use(tableWrapper) 17 | md.use(tooltip) 18 | md.use(tag) 19 | md.use(mdContainer, 'demo', createDemoContainer(md)) 20 | md.use(ApiTableContainer) 21 | md.use(groupIconMdPlugin as unknown as (md: MarkdownRenderer) => void) 22 | } 23 | -------------------------------------------------------------------------------- /packages/utils/objects.ts: -------------------------------------------------------------------------------- 1 | import type { Entries } from 'type-fest' 2 | import type { Arrayable } from './types' 3 | /* 4 | * @Author: zouyaoji@https://github.com/zouyaoji 5 | * @Date: 2022-08-03 13:30:02 6 | * @LastEditTime: 2023-04-15 16:27:26 7 | * @LastEditors: zouyaoji 370681295@qq.com 8 | * @Description: 9 | * @FilePath: \vue-cesium\packages\utils\objects.ts 10 | */ 11 | import { get, set } from 'lodash-unified' 12 | 13 | export const keysOf = (arr: T) => Object.keys(arr) as Array 14 | export const entriesOf = (arr: T) => Object.entries(arr) as Entries 15 | export { hasOwn } from './util' 16 | 17 | export function getProp(obj: Record, path: Arrayable, defaultValue?: any): { value: T } { 18 | return { 19 | get value() { 20 | return get(obj, path, defaultValue) 21 | }, 22 | set value(val: any) { 23 | set(obj, path, val) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/navbar/vp-theme-toggler.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 35 | -------------------------------------------------------------------------------- /internal/build/plugins/alias.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-03 14:11:08 4 | * @LastEditTime: 2024-06-08 11:44:06 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\build\plugins\alias.ts 8 | */ 9 | import { PKG_NAME, PKG_PREFIX } from '../utils/constants' 10 | import type { Plugin } from 'rollup' 11 | 12 | export function alias(): Plugin { 13 | const themeDefault = 'theme-default' 14 | const sourceThemeDefault = `${PKG_PREFIX}/${themeDefault}` as const 15 | const bundleThemeDefault = `${PKG_NAME}/${themeDefault}` as const 16 | 17 | return { 18 | name: 'vue-cesium-alias-plugin', 19 | resolveId(id) { 20 | if (!id.startsWith(sourceThemeDefault)) return 21 | return { 22 | id: id.replaceAll(sourceThemeDefault, bundleThemeDefault), 23 | external: 'absolute' 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/components/overlays/wind/glsl/screenDraw.frag.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-28 09:20:11 4 | * @LastEditTime: 2023-06-12 18:10:22 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\overlays\wind\glsl\screenDraw.frag.ts 8 | */ 9 | const text = ` 10 | uniform sampler2D trailsColorTexture; 11 | uniform sampler2D trailsDepthTexture; 12 | 13 | in vec2 textureCoordinate; 14 | 15 | void main() { 16 | vec4 trailsColor = texture(trailsColorTexture, textureCoordinate); 17 | float trailsDepth = texture(trailsDepthTexture, textureCoordinate).r; 18 | float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, textureCoordinate)); 19 | 20 | if (trailsDepth < globeDepth) { 21 | out_FragColor = trailsColor; 22 | } else { 23 | out_FragColor = vec4(0.0); 24 | } 25 | } 26 | ` 27 | export default text 28 | -------------------------------------------------------------------------------- /packages/components/overlays/wind/glsl/updatePosition.frag.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-28 09:20:11 4 | * @LastEditTime: 2021-10-28 10:05:45 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\overlays\wind\glsl\updatePosition.ts 8 | */ 9 | const text = ` 10 | uniform sampler2D currentParticlesPosition; // (lon, lat, lev) 11 | uniform sampler2D particlesSpeed; // (u, v, w, norm) Unit converted to degrees of longitude and latitude 12 | 13 | in vec2 v_textureCoordinates; 14 | 15 | void main() { 16 | // texture coordinate must be normalized 17 | vec3 lonLatLev = texture(currentParticlesPosition, v_textureCoordinates).rgb; 18 | vec3 speed = texture(particlesSpeed, v_textureCoordinates).rgb; 19 | vec3 nextParticle = lonLatLev + speed; 20 | 21 | out_FragColor = vec4(nextParticle, 0.0); 22 | } 23 | ` 24 | export default text 25 | -------------------------------------------------------------------------------- /packages/composables/private/use-transition.ts: -------------------------------------------------------------------------------- 1 | import { computed, nextTick, ref, watch } from 'vue' 2 | 3 | export const useTransitionProps = { 4 | transitionShow: { 5 | type: String, 6 | default: 'fade' 7 | }, 8 | 9 | transitionHide: { 10 | type: String, 11 | default: 'fade' 12 | }, 13 | 14 | transitionDuration: { 15 | type: [String, Number], 16 | default: 300 17 | } 18 | } 19 | 20 | export default function (props, showing) { 21 | const transitionState = ref(showing.value) 22 | 23 | watch(showing, (val) => { 24 | nextTick(() => { 25 | transitionState.value = val 26 | }) 27 | }) 28 | 29 | // return transition 30 | return { 31 | transition: computed(() => `vc-transition--${transitionState.value === true ? props.transitionHide : props.transitionShow}`), 32 | 33 | transitionStyle: computed(() => `--vc-transition-duration: ${props.transitionDuration}ms`) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/pages/sidebar.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": [ 3 | { 4 | "text": "Guide", 5 | "link": "/guide/installation", 6 | "activeMatch": "/guide/" 7 | }, 8 | { 9 | "text": "Component", 10 | "link": "/component/config-provider", 11 | "activeMatch": "/component/" 12 | }, 13 | { 14 | "text": "Discussions", 15 | "link": "https://github.com/zouyaoji/vue-cesium/discussions", 16 | "activeMatch": "/resource/" 17 | } 18 | ], 19 | "zh-CN": [ 20 | { 21 | "text": "指南", 22 | "link": "/guide/installation", 23 | "activeMatch": "/guide/" 24 | }, 25 | { 26 | "text": "组件", 27 | "link": "/component/config-provider", 28 | "activeMatch": "/component/" 29 | }, 30 | { 31 | "text": "讨论", 32 | "link": "https://github.com/zouyaoji/vue-cesium/discussions", 33 | "activeMatch": "/resource/" 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "strict": true, 5 | "module": "esnext", 6 | "target": "es2018", 7 | "baseUrl": ".", 8 | "noImplicitAny": false, 9 | "declaration": true, 10 | "declarationMap": true, 11 | "moduleResolution": "Node", 12 | "esModuleInterop": true, 13 | "preserveSymlinks": true, 14 | "jsx": "preserve", 15 | "sourceMap": true, 16 | "lib": ["ES2018", "DOM", "DOM.Iterable"], 17 | "allowSyntheticDefaultImports": true, 18 | "forceConsistentCasingInFileNames": true, 19 | "noUnusedLocals": false, 20 | "resolveJsonModule": true, 21 | "strictNullChecks": false, 22 | "removeComments": false, 23 | "rootDir": ".", 24 | "types": ["node", "jest"], 25 | "paths": { 26 | "@vue-cesium/*": ["package/*"] 27 | } 28 | }, 29 | "include": ["packages", "typings"], 30 | "exclude": ["node_modules", "**/dist"] 31 | } 32 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/sponsors/sponsors-button.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 28 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/overview-icons/ov-link.vue: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /packages/components/providers/baidu/Point.ts: -------------------------------------------------------------------------------- 1 | import { isString } from '@vue-cesium/utils/util' 2 | 3 | class Point { 4 | lat: number 5 | lng: number 6 | constructor(lng, lat) { 7 | // 新增base64支持 - by jz 8 | if (Number.isNaN(lng)) { 9 | // lng = decode64(lng) 10 | lng = Number.isNaN(lng) ? 0 : lng 11 | } 12 | if (isString(lng)) { 13 | lng = Number.parseFloat(lng) 14 | } 15 | if (Number.isNaN(lat)) { 16 | // lat = decode64(lat) 17 | lat = Number.isNaN(lat) ? 0 : lat 18 | } 19 | if (isString(lat)) { 20 | lat = Number.parseFloat(lat) 21 | } 22 | this.lng = lng 23 | this.lat = lat 24 | } 25 | 26 | equals(other) { 27 | return other && this.lat === other.lat && this.lng === other.lng 28 | } 29 | 30 | static isInRange = function (pt) { 31 | return pt && pt.lng <= 180 && pt.lng >= -180 && pt.lat <= 74 && pt.lat >= -74 32 | } 33 | } 34 | 35 | export default Point 36 | -------------------------------------------------------------------------------- /packages/composables/private/use-vc-extension.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2022-04-25 16:05:16 4 | * @LastEditTime: 2023-08-18 01:08:33 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\packages\composables\private\use-vc-extension.ts 8 | */ 9 | import { MaterialExtend, RectangleExtend, ShadowMapShaderExtend } from '@vue-cesium/shared' 10 | 11 | const vcExtends = [RectangleExtend, ShadowMapShaderExtend, MaterialExtend] 12 | 13 | export default function useVcExtension() { 14 | const invokeExtensions = (viewer: Cesium.Viewer) => { 15 | vcExtends.forEach((item) => { 16 | item.extend(viewer) 17 | }) 18 | } 19 | 20 | const revokeExtensions = (viewer: Cesium.Viewer) => { 21 | vcExtends.forEach((item) => { 22 | item.revoke(viewer) 23 | }) 24 | } 25 | 26 | return { 27 | invokeExtensions, 28 | revokeExtensions 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/demo.scss: -------------------------------------------------------------------------------- 1 | $namespace: 'vc'; 2 | 3 | .demo-viewer { 4 | width: 100%; 5 | height: 500px; 6 | overflow: hidden; 7 | 8 | .demo-toolbar { 9 | position: absolute; 10 | left: 1%; 11 | top: 1%; 12 | min-width: 185px; 13 | // max-width: 300px; 14 | z-index: 100; 15 | color: white; 16 | background-color: rgba(0, 0, 0, 0.2); 17 | 18 | .block { 19 | .#{$namespace}-select { 20 | width: 100%; 21 | } 22 | } 23 | } 24 | 25 | .#{$namespace}-row { 26 | border-radius: 100px; 27 | align-items: baseline; 28 | 29 | &:last-child { 30 | margin-bottom: 0; 31 | } 32 | } 33 | .#{$namespace}-button { 34 | margin: 10px 10px 10px 0; 35 | 36 | &:first-child { 37 | margin-left: 20px; 38 | } 39 | } 40 | 41 | .#{$namespace}-switch__label { 42 | color: white; 43 | } 44 | 45 | .#{$namespace}-checkbox__label { 46 | color: white; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/content/tag-content.scss: -------------------------------------------------------------------------------- 1 | .vp-tag { 2 | --vp-tag-color: var(--el-color-primary); 3 | --vp-tag-border-color: var(--el-color-primary); 4 | 5 | display: inline-block; 6 | padding: 0 7px; 7 | border-radius: 10px; 8 | border: 1px solid var(--vp-tag-border-color); 9 | font-size: var(--el-font-size-extra-small); 10 | color: var(--vp-tag-color); 11 | line-height: 18px; 12 | white-space: nowrap; 13 | 14 | &.beta { 15 | --vp-tag-color: var(--el-color-danger); 16 | --vp-tag-border-color: var(--el-color-danger); 17 | } 18 | &.deprecated { 19 | --vp-tag-color: var(--el-color-warning); 20 | --vp-tag-border-color: var(--el-color-warning); 21 | } 22 | &.a11y { 23 | --vp-tag-color: var(--purple-color); 24 | --vp-tag-border-color: var(--purple-color-light); 25 | } 26 | &.required { 27 | --vp-tag-color: var(--el-color-success); 28 | --vp-tag-border-color: var(--el-color-success); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/shared/src/index.ts: -------------------------------------------------------------------------------- 1 | import DebugCameraPrimitive from './DebugCameraPrimitive' 2 | import DrawStatus from './DrawStatus' 3 | import DynamicOverlay from './DynamicOverlay' 4 | import MeasureUnits, { AngleUnits, AreaUnits, DistanceUnits, VolumeUnits } from './MeasureUnits' 5 | import PolygonPrimitive from './PolygonPrimitive' 6 | import PrimitiveCluster from './PrimitiveCluster' 7 | /* 8 | * @Author: zouyaoji@https://github.com/zouyaoji 9 | * @Date: 2021-10-27 15:54:11 10 | * @LastEditTime: 2023-06-05 11:50:09 11 | * @LastEditors: zouyaoji 370681295@qq.com 12 | * @Description: 13 | * @FilePath: \vue-cesium\packages\shared\src\index.ts 14 | */ 15 | import VisibilityState from './VisibilityState' 16 | 17 | export { 18 | AngleUnits, 19 | AreaUnits, 20 | DebugCameraPrimitive, 21 | DistanceUnits, 22 | DrawStatus, 23 | DynamicOverlay, 24 | MeasureUnits, 25 | PolygonPrimitive, 26 | PrimitiveCluster, 27 | VisibilityState, 28 | VolumeUnits 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | name: Unit Test 2 | 3 | on: pull_request 4 | 5 | jobs: 6 | build: 7 | name: Unit Test 8 | runs-on: windows-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - name: Setup node 12 | uses: actions/setup-node@v3 13 | with: 14 | node-version: 16 15 | registry-url: https://registry.npmjs.com/ 16 | 17 | - name: Setup pnpm 18 | uses: pnpm/action-setup@v2 19 | with: 20 | version: 8.4.0 21 | 22 | - name: Install dependencies 23 | run: pnpm i --frozen-lockfile 24 | - name: Lint 25 | run: pnpm lint 26 | # - name: Test 27 | # run: pnpm test 28 | 29 | dependabot: 30 | needs: 31 | - build 32 | runs-on: ubuntu-latest 33 | steps: 34 | - name: auto-merge 35 | uses: ridedott/dependabot-auto-merge-action@master 36 | with: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/common/vp-markdown.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 31 | 32 | 37 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-08-26 18:47:27 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-23 18:42:57 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\index.ts 8 | */ 9 | import VcCircleWaveMaterial from './VcCircleWaveMaterial' 10 | import VcLineFlowColorMaterial from './VcLineFlowColorMaterial' 11 | import VcLineFlowMaterial from './VcLineFlowMaterial' 12 | import VcLineTrailColorMaterial from './VcLineTrailColorMaterial' 13 | import VcLineTrailMaterial from './VcLineTrailMaterial' 14 | import VcODLineMaterial from './VcODLineMaterial' 15 | import VcScanLineMaterial from './VcScanLineMaterial' 16 | 17 | export { 18 | VcCircleWaveMaterial, 19 | VcLineFlowColorMaterial, 20 | VcLineFlowMaterial, 21 | VcLineTrailColorMaterial, 22 | VcLineTrailMaterial, 23 | VcODLineMaterial, 24 | VcScanLineMaterial 25 | } 26 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/demo-block.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "view-source": "View source", 4 | "hide-source": "Hide source", 5 | "edit-in-editor": "Edit in Playground", 6 | "edit-on-github": "Edit on GitHub", 7 | "edit-in-codepen": "Edit in Codepen.io", 8 | "copy-code": "Copy code", 9 | "switch-button-option-text": "Switch to Options API", 10 | "switch-button-setup-text": "Switch to Composition API", 11 | "copy-success": "Copied!", 12 | "copy-error": "This browser does not support automatic copy!" 13 | }, 14 | "zh-CN": { 15 | "view-source": "查看源代码", 16 | "hide-source": "隐藏源代码", 17 | "edit-in-editor": "在 Playground 中编辑", 18 | "edit-on-github": "在 GitHub 中编辑", 19 | "edit-in-codepen": "在 Codepen.io 中编辑", 20 | "copy-code": "复制代码", 21 | "switch-button-option-text": "切换到选项式 API", 22 | "switch-button-setup-text": "切换到组合式 API", 23 | "copy-success": "已复制", 24 | "copy-error": "此浏览器不支持自动复制" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/components/ui/fab/defaultProps.ts: -------------------------------------------------------------------------------- 1 | import { useModelToggleProps } from '@vue-cesium/composables/private/use-model-toggle' 2 | import { useFabProps } from './use-fab' 3 | 4 | const directions = ['up', 'right', 'down', 'left'] 5 | const alignValues = ['left', 'center', 'right'] 6 | 7 | const defaultProps = { 8 | ...useFabProps, 9 | ...useModelToggleProps, 10 | 11 | icon: String, 12 | activeIcon: String, 13 | hideActionOnClick: { 14 | type: Boolean, 15 | default: true 16 | }, 17 | hideIcon: Boolean, 18 | hideLabel: { 19 | type: Boolean, 20 | default: true 21 | }, 22 | 23 | direction: { 24 | type: String, 25 | default: 'right', 26 | validator: (v: string) => directions.includes(v) 27 | }, 28 | 29 | persistent: Boolean, 30 | stacked: Boolean, 31 | verticalActionsAlign: { 32 | type: String, 33 | default: 'center', 34 | validator: v => alignValues.includes(v) 35 | } 36 | } 37 | 38 | export default defaultProps 39 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/full-screen/vp-menu-link.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 24 | 42 | -------------------------------------------------------------------------------- /packages/shared/extends/materials/VcBaseMaterialProperty.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-08-17 00:20:37 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2023-08-17 00:27:14 7 | * @FilePath: \vue-cesium\packages\shared\materials\VcBaseMaterialProperty.ts 8 | */ 9 | export default class BaseMaterialProperty { 10 | options: any 11 | _definitionChanged: Cesium.Event<(...args: any[]) => void> 12 | constructor(options = {}) { 13 | this.options = options 14 | this._definitionChanged = new Cesium.Event() 15 | } 16 | 17 | get isConstant() { 18 | return true 19 | } 20 | 21 | get definitionChanged() { 22 | return this._definitionChanged 23 | } 24 | 25 | getType(parameter) { 26 | return null 27 | } 28 | 29 | getValue(context, defaultValue = {}) { 30 | return defaultValue 31 | } 32 | 33 | equals(other) { 34 | return this === other 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/theme-default/src/status-bar.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-status-bar { 4 | cursor: pointer; 5 | position: absolute; 6 | z-index: $z-side; 7 | margin-right: 5px; 8 | 9 | box-sizing: border-box; 10 | float: left; 11 | padding: 5px 5px; 12 | font-size: 0.7rem; 13 | text-align: center; 14 | line-height: 1; 15 | border: 0; 16 | outline: 0; 17 | font-family: monospace, sans-serif; 18 | max-height: 21px; 19 | margin-top: 5px; 20 | 21 | span { 22 | padding: 0 5px; 23 | } 24 | 25 | li, 26 | div { 27 | display: inline-block; 28 | padding: 0 5px; 29 | text-align: left; 30 | } 31 | 32 | .vc-section-long { 33 | width: 160px; 34 | } 35 | 36 | .vc-section { 37 | width: 135px; 38 | } 39 | 40 | .vc-section-short { 41 | width: 100px; 42 | } 43 | 44 | .vc-section-mini { 45 | width: 50px; 46 | } 47 | } 48 | 49 | .vc-location-other-controls .vc-status-bar { 50 | position: relative; 51 | } 52 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/navbar/vp-social-link.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 35 | 36 | 41 | -------------------------------------------------------------------------------- /internal/build/gen-version.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-03 14:23:35 4 | * @LastEditTime: 2025-03-29 16:42:34 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\internal\build\gen-version.ts 8 | */ 9 | 10 | import { writeFile } from 'fs/promises' 11 | import path from 'path' 12 | import consola from 'consola' 13 | import { vcRoot } from '@vue-cesium/build' 14 | import pkg from '../../packages/vue-cesium/package.json' // need to be checked 15 | 16 | function getVersion() { 17 | const tagVer = process.env.TAG_VERSION 18 | if (tagVer) { 19 | return tagVer.startsWith('v') ? tagVer.slice(1) : tagVer 20 | } else { 21 | return pkg.version 22 | } 23 | } 24 | 25 | const version = getVersion() 26 | 27 | async function main() { 28 | consola.info(`Version: ${version}`) 29 | await writeFile(path.resolve(vcRoot, 'version.ts'), `export const version = '${version}'\n`) 30 | } 31 | 32 | main() 33 | -------------------------------------------------------------------------------- /docs/public/images/element-plus-logo-small.svg: -------------------------------------------------------------------------------- 1 | element plus-logo-small 副本 -------------------------------------------------------------------------------- /packages/composables/private/use-form.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-03-28 10:20:47 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2023-03-29 16:01:06 7 | * @FilePath: \vue-cesium@next\packages\composables\private\use-form.ts 8 | */ 9 | import { computed, h } from 'vue' 10 | 11 | export const useFormProps = { 12 | name: String 13 | } 14 | 15 | export function useFormAttrs(props) { 16 | return computed(() => ({ 17 | type: 'hidden', 18 | name: props.name, 19 | value: props.modelValue 20 | })) 21 | } 22 | 23 | export function useFormInject(formAttrs: any = {}) { 24 | return (child, action, className?: string) => { 25 | child[action]( 26 | h('input', { 27 | class: `hidden${className || ''}`, 28 | ...formAttrs.value 29 | }) 30 | ) 31 | } 32 | } 33 | 34 | export function useFormInputNameAttr(props) { 35 | return computed(() => props.name || props.for) 36 | } 37 | -------------------------------------------------------------------------------- /docs/.vitepress/plugins/tooltip.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | 3 | export default (md: MarkdownRenderer): void => { 4 | md.renderer.rules.tooltip = (tokens, idx) => { 5 | const token = tokens[idx] 6 | 7 | return `` 8 | } 9 | 10 | md.inline.ruler.before('emphasis', 'tooltip', (state, silent) => { 11 | const tooltipRegExp = /^\^\[([^\]]*)\](`[^`]*`)?/ 12 | const str = state.src.slice(state.pos, state.posMax) 13 | 14 | if (!tooltipRegExp.test(str)) 15 | return false 16 | if (silent) 17 | return true 18 | 19 | const result = str.match(tooltipRegExp) 20 | 21 | if (!result) 22 | return false 23 | 24 | const token = state.push('tooltip', 'tooltip', 0) 25 | token.content = result[1].replace(/\\\|/g, '|') 26 | token.info = (result[2] || '').replace(/^`(.*)`$/, '$1') 27 | token.level = state.level 28 | state.pos += result[0].length 29 | 30 | return true 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /packages/utils/private/global-nodes.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-06 09:21:02 4 | * @LastEditTime: 2021-10-02 23:14:39 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\private\global-nodes.ts 8 | */ 9 | const globalNodes: Array = [] 10 | let target = document.body 11 | 12 | export function createGlobalNode(id?) { 13 | const el = document.createElement('div') 14 | 15 | if (id !== void 0) { 16 | el.id = id 17 | } 18 | 19 | target.appendChild(el) 20 | globalNodes.push(el) 21 | 22 | return el 23 | } 24 | 25 | export function removeGlobalNode(el) { 26 | globalNodes.splice(globalNodes.indexOf(el), 1) 27 | el.remove() 28 | } 29 | 30 | export function changeGlobalNodesTarget(el) { 31 | if (el !== target) { 32 | target = el 33 | 34 | globalNodes.forEach((el) => { 35 | if (el.contains(target) === false) { 36 | target.appendChild(el) 37 | } 38 | }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/.vitepress/i18n/component/anchor.json: -------------------------------------------------------------------------------- 1 | { 2 | "en-US": { 3 | "basic-usage": "basic-usage", 4 | "horizontal-mode": "horizontal-mode", 5 | "scroll-container": "scroll-container", 6 | "anchor-api": "anchor-api", 7 | "anchor-attributes": "anchor-attributes", 8 | "anchor-events": "anchor-events", 9 | "Basic Usage": "Basic Usage", 10 | "Horizontal Mode": "Horizontal Mode", 11 | "Scroll Container": "Scroll Container", 12 | "Anchor API": "Anchor API", 13 | "Anchor Attributes": "Anchor Attributes", 14 | "Anchor Events": "Anchor Events" 15 | }, 16 | "zh-CN": { 17 | "basic-usage": "基础用法", 18 | "horizontal-mode": "水平模式", 19 | "scroll-container": "滚动的容器", 20 | "anchor-api": "锚点-api", 21 | "anchor-attributes": "锚点属性", 22 | "anchor-events": "锚点事件", 23 | "Basic Usage": "基础用法", 24 | "Horizontal Mode": "水平模式", 25 | "Scroll Container": "滚动的容器", 26 | "Anchor API": "锚点 API", 27 | "Anchor Attributes": "锚点属性", 28 | "Anchor Events": "锚点事件" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /internal/metadata/src/components.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-12 23:15:41 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-21 23:33:02 7 | * @FilePath: \vue-cesium\internal\metadata\src\components.ts 8 | */ 9 | import path from 'path' 10 | import glob from 'fast-glob' 11 | import chalk from 'chalk' 12 | import consola from 'consola' 13 | import { ensureDir, projRoot, writeJson } from '@vue-cesium/build' 14 | 15 | const pathOutput = path.resolve(__dirname, '..', 'dist') 16 | 17 | async function main() { 18 | await ensureDir(pathOutput) 19 | 20 | const components = await glob('**/', { 21 | cwd: path.resolve(projRoot, 'packages/components'), 22 | onlyDirectories: true, 23 | ignore: ['**/__test__/**', '**/src/**'] 24 | }) 25 | 26 | await writeJson(path.resolve(pathOutput, 'components.json'), components) 27 | consola.success(chalk.green('Component list generated', components)) 28 | } 29 | 30 | main() 31 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-sponsors.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 36 | -------------------------------------------------------------------------------- /packages/composables/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-11 09:17:23 4 | * @LastEditTime: 2021-10-26 14:29:28 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\composables\index.ts 8 | */ 9 | export { default as useCommon } from './use-common' 10 | export { default as useDatasources } from './use-datasources' 11 | export { default as useEvents } from './use-events' 12 | export { default as useGeometries } from './use-geometries' 13 | export { default as useGraphics } from './use-graphics' 14 | export { default as useHandler } from './use-handler' 15 | export * from './use-locale' 16 | export { default as usePrimitiveCollectionItems } from './use-primitive-collection-items' 17 | export { default as usePrimitiveCollections } from './use-primitive-collections' 18 | export { default as usePrimitives } from './use-primitives' 19 | export { default as useProviders } from './use-providers' 20 | 21 | export { default as useVueCesium } from './use-vue-cesium' 22 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcLineFlowColorMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-22 11:59:12 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-22 12:06:00 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcLineFlowColorMaterial.ts 8 | */ 9 | export default ` 10 | uniform vec4 color; 11 | uniform float speed; 12 | uniform float startTime; 13 | uniform float percent; 14 | uniform float alpha; 15 | uniform float globalAlpha; 16 | 17 | czm_material czm_getMaterial(czm_materialInput materialInput) { 18 | czm_material material = czm_getDefaultMaterial(materialInput); 19 | vec2 st = materialInput.st; 20 | float t = fract(startTime + czm_frameNumber * speed / 1000.0); 21 | t *= (1.0 + percent); 22 | float alphaVC = smoothstep(t - percent, t, st.s) * step(-t, -st.s); 23 | alphaVC += alpha; 24 | material.diffuse = color.rgb; 25 | material.alpha = alphaVC * globalAlpha; 26 | return material; 27 | } 28 | ` 29 | -------------------------------------------------------------------------------- /docs/.vitepress/plugins/tag.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | 3 | export default (md: MarkdownRenderer): void => { 4 | md.inline.ruler.before('emphasis', 'tag', (state, silent) => { 5 | const tagRegExp = /^\^\(([^)]*)\)/ 6 | const str = state.src.slice(state.pos, state.posMax) 7 | 8 | if (!tagRegExp.test(str)) 9 | return false 10 | if (silent) 11 | return true 12 | 13 | const result = str.match(tagRegExp) 14 | 15 | if (!result) 16 | return false 17 | 18 | const token = state.push('html_inline', '', 0) 19 | const value = result[1].trim() 20 | /** 21 | * Add styles for some special tags 22 | * vitepress/styles/content/tag-content.scss 23 | */ 24 | const tagClass = ['beta', 'deprecated', 'a11y', 'required'].includes(value) 25 | ? value 26 | : '' 27 | token.content = `${value}` 28 | token.level = state.level 29 | state.pos += result[0].length 30 | 31 | return true 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-nav.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 29 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-subnav.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 36 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/content.scss: -------------------------------------------------------------------------------- 1 | @use './mixins' as *; 2 | @use './vars' as *; 3 | @use './content/doc-content'; 4 | @use './content/hero-content'; 5 | @use './content/tag-content'; 6 | 7 | .page-content { 8 | outline: none; 9 | @include respond-to('lg') { 10 | padding-top: var(--nav-height); 11 | 12 | &.has-sidebar { 13 | padding-left: calc(var(--sidebar-width-sm) + 10px); 14 | @include respond-to('xlg') { 15 | padding-left: calc(var(--vp-sidebar-width-small)); 16 | } 17 | @include respond-to('xxl') { 18 | padding-left: calc(var(--vp-sidebar-width-small) + 32px); 19 | } 20 | @include respond-to('max') { 21 | padding-left: calc(var(--vp-sidebar-width-small) + 48px); 22 | } 23 | } 24 | } 25 | 26 | .doc-content a { 27 | display: inline-flex; 28 | align-items: center; 29 | &.vp-link { 30 | white-space: nowrap; 31 | } 32 | .link-icon { 33 | margin-left: 0.25rem; 34 | height: 1em; 35 | width: 1em; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcRectSlideMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-23 16:55:40 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-23 16:56:34 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcRectSlideMaterial.ts 8 | */ 9 | export default ` 10 | uniform float globalAlpha; 11 | uniform sampler2D image; 12 | uniform vec4 color; 13 | uniform float speed; 14 | uniform bool pure; 15 | uniform float diffusePower; 16 | 17 | czm_material czm_getMaterial(czm_materialInput materialInput) { 18 | czm_material material = czm_getDefaultMaterial(materialInput); 19 | vec2 st = materialInput.st; 20 | vec4 imageMars3D = texture(image, vec2(fract(st.s + czm_frameNumber * speed / 1000.0), fract(st.t))); 21 | 22 | material.alpha = imageMars3D.a * color.a * globalAlpha; 23 | if(pure) { 24 | material.diffuse = diffusePower * color.rgb; 25 | } else { 26 | material.diffuse = imageMars3D.rgb; 27 | } 28 | return material; 29 | } 30 | ` 31 | -------------------------------------------------------------------------------- /packages/components/ui/spinner/spinner.ts: -------------------------------------------------------------------------------- 1 | import { defineComponent, h } from 'vue' 2 | 3 | import useSpinner, { useSpinnerProps } from './use-spinner' 4 | 5 | export default defineComponent({ 6 | name: 'VcSpinner', 7 | 8 | props: { 9 | ...useSpinnerProps, 10 | 11 | thickness: { 12 | type: Number, 13 | default: 5 14 | } 15 | }, 16 | 17 | setup(props) { 18 | const { cSize, classes } = useSpinner(props) 19 | 20 | return () => 21 | h( 22 | 'svg', 23 | { 24 | class: `${classes.value} vc-spinner-mat`, 25 | width: cSize.value, 26 | height: cSize.value, 27 | viewBox: '25 25 50 50' 28 | }, 29 | [ 30 | h('circle', { 31 | 'class': 'path', 32 | 'cx': '50', 33 | 'cy': '50', 34 | 'r': '20', 35 | 'fill': 'none', 36 | 'stroke': 'currentColor', 37 | 'stroke-width': props.thickness, 38 | 'stroke-miterlimit': '10' 39 | }) 40 | ] 41 | ) 42 | } 43 | }) 44 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/overview-icons/ov-skeleton.vue: -------------------------------------------------------------------------------- 1 | 45 | -------------------------------------------------------------------------------- /packages/components/analyses/index.ts: -------------------------------------------------------------------------------- 1 | import type { SFCWithInstall } from '@vue-cesium/utils/types' 2 | /* 3 | * @Author: zouyaoji@https://github.com/zouyaoji 4 | * @Date: 2021-12-31 11:46:30 5 | * @LastEditTime: 2022-02-18 23:48:49 6 | * @LastEditors: zouyaoji 7 | * @Description: 8 | * @FilePath: \vue-cesium@next\packages\components\analyses\index.ts 9 | */ 10 | import type { App } from 'vue' 11 | import AnalysisFlood from './flood' 12 | 13 | import Analyses from './src' 14 | 15 | const components = [AnalysisFlood, Analyses] 16 | 17 | function install(app: App): void { 18 | components.forEach((cmp) => { 19 | app.component(cmp.name, cmp) 20 | }) 21 | } 22 | 23 | export default { 24 | install 25 | } 26 | 27 | components.forEach((cmp) => { 28 | cmp['install'] = (app: App): void => { 29 | app.component(cmp.name, cmp) 30 | } 31 | }) 32 | 33 | export const VcAnalysisFlood = AnalysisFlood as SFCWithInstall 34 | export const VcAnalyses = Analyses as SFCWithInstall 35 | 36 | export * from './flood' 37 | export * from './src' 38 | -------------------------------------------------------------------------------- /packages/locale/__test__/locale.spec.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect } from 'vitest' 2 | /* 3 | * @Author: zouyaoji@https://github.com/zouyaoji 4 | * @Date: 2021-04-13 22:43:29 5 | * @LastEditTime: 2023-04-14 00:49:29 6 | * @LastEditors: tbayri yo@tayebbayri.com 7 | * @Description: 8 | * @FilePath: \vue-cesium\packages\locale\__test__\locale.spec.ts 9 | */ 10 | import { t, use } from '../index' 11 | import en from '../lang/en-us' 12 | import fr from '../lang/fr-fr' 13 | import zhCn from '../lang/zh-hans' 14 | 15 | describe('locale', () => { 16 | it('t', () => { 17 | expect(t('vc.navigation.compass.title')).toBe('按住鼠标拖拽旋转相机。') 18 | }) 19 | 20 | it('return key name if not defined', () => { 21 | expect(t('vc.navigation.compass.someThing')).toBeUndefined() 22 | }) 23 | 24 | it('use', () => { 25 | use(en) 26 | expect(t('vc.navigation.compass.title')).toBe('Click and drag to rotate the camera.') 27 | 28 | use(fr) 29 | expect(t('vc.navigation.compass.title')).toBe('Cliquer et faire glisser pour pivoter la caméra.') 30 | use(zhCn) 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/vp-api-function.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/playground.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-sidebar.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 37 | -------------------------------------------------------------------------------- /packages/utils/platform.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-04-08 18:37:31 4 | * @LastEditTime: 2022-04-11 23:02:05 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\utils\platform.ts 8 | */ 9 | export function platform() { 10 | const ua = navigator.userAgent 11 | const isWindowsPhone = /Windows Phone/.test(ua) 12 | const isSymbian = /SymbianOS/.test(ua) || isWindowsPhone 13 | const isAndroid = /Android/.test(ua) 14 | const isFireFox = /Firefox/.test(ua) 15 | const isChrome = /Chrome|CriOS/.test(ua) 16 | const isTablet = /iPad|PlayBook/.test(ua) || (isAndroid && !/Mobile/.test(ua)) || (isFireFox && /Tablet/.test(ua)) 17 | const isPhone = /iPhone/.test(ua) && !isTablet 18 | const isPc = !isPhone && !isAndroid && !isSymbian 19 | const isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) 20 | return { 21 | isTablet, 22 | isPhone, 23 | isAndroid, 24 | isPc, 25 | isFireFox, 26 | isChrome, 27 | isIOS, 28 | hasTouch: 'ontouchstart' in window || window.navigator.maxTouchPoints > 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/icons/light.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcLineBloomMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2024-06-23 16:33:39 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-23 16:34:24 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcLineBloomMaterial.ts 8 | */ 9 | export default ` 10 | uniform vec4 color; 11 | uniform float speed; 12 | uniform float glow; 13 | uniform float globalAlpha; 14 | 15 | czm_material czm_getMaterial(czm_materialInput materialInput) { 16 | czm_material material = czm_getDefaultMaterial(materialInput); 17 | 18 | vec2 st = materialInput.st; 19 | float t = fract(speed * czm_frameNumber / 1000.0); 20 | t *= 1.03; 21 | 22 | float alphaMars3D = smoothstep(t - 0.03, t, st.s) * step(-t, -st.s); 23 | alphaMars3D += 0.1; 24 | 25 | vec4 fragColor; 26 | fragColor.rgb = (color.rgb) / 0.5; 27 | fragColor = czm_gammaCorrect(fragColor); 28 | material.diffuse = fragColor.rgb; 29 | material.alpha = alphaMars3D * globalAlpha; 30 | material.emission = fragColor.rgb * glow; 31 | return material; 32 | } 33 | ` 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 zouyaoji <370681295@qq.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/theme-default/src/core/mouse.scss: -------------------------------------------------------------------------------- 1 | .non-selectable { 2 | user-select: none !important; 3 | } 4 | 5 | .scroll { 6 | overflow: auto; 7 | } 8 | 9 | .scroll, 10 | .scroll-x, 11 | .scroll-y { 12 | -webkit-overflow-scrolling: touch; 13 | will-change: scroll-position; 14 | } 15 | 16 | .scroll-x { 17 | overflow-x: auto; 18 | } 19 | 20 | .scroll-y { 21 | overflow-y: auto; 22 | } 23 | 24 | .no-scroll { 25 | overflow: hidden !important; 26 | } 27 | 28 | .no-pointer-events, 29 | .no-pointer-events--children, 30 | .no-pointer-events--children * { 31 | pointer-events: none !important; 32 | } 33 | 34 | .all-pointer-events { 35 | pointer-events: all !important; 36 | } 37 | 38 | .cursor { 39 | &-pointer { 40 | cursor: pointer !important; 41 | } 42 | 43 | &-not-allowed { 44 | cursor: not-allowed !important; 45 | } 46 | 47 | &-inherit { 48 | cursor: inherit !important; 49 | } 50 | 51 | &-none { 52 | cursor: none !important; 53 | } 54 | } 55 | 56 | [aria-busy='true'] { 57 | cursor: progress; 58 | } 59 | 60 | [aria-controls] { 61 | cursor: pointer; 62 | } 63 | 64 | [aria-disabled] { 65 | cursor: default; 66 | } 67 | -------------------------------------------------------------------------------- /internal/build/utils/process.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-12-03 14:11:08 4 | * @LastEditTime: 2024-06-08 16:10:55 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @Description: 7 | * @FilePath: \vue-cesium\build\utils\process.ts 8 | */ 9 | import { spawn } from 'child_process' 10 | import chalk from 'chalk' 11 | import consola from 'consola' 12 | import { projRoot } from './paths' 13 | 14 | export const run = async (command: string, cwd: string = projRoot) => 15 | new Promise((resolve, reject) => { 16 | const [cmd, ...args] = command.split(' ') 17 | consola.info(`run: ${chalk.green(`${cmd} ${args.join(' ')}`)}`) 18 | const app = spawn(cmd, args, { 19 | cwd, 20 | stdio: 'inherit', 21 | shell: process.platform === 'win32' 22 | }) 23 | 24 | const onProcessExit = () => app.kill('SIGHUP') 25 | 26 | app.on('close', code => { 27 | process.removeListener('exit', onProcessExit) 28 | 29 | if (code === 0) resolve() 30 | else reject(new Error(`Command failed. \n Command: ${command} \n Code: ${code}`)) 31 | }) 32 | process.on('exit', onProcessExit) 33 | }) 34 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/styles/common/hamburger.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins' as *; 2 | 3 | .menu-hamburger { 4 | width: 20px; 5 | display: flex; 6 | flex-direction: column; 7 | cursor: pointer; 8 | justify-content: center; 9 | height: var(--nav-height); 10 | margin: 0 14px; 11 | 12 | > span { 13 | background-color: var(--text-color); 14 | border-radius: 10px; 15 | height: 2px; 16 | margin: 2px 0; 17 | transition: var(--el-transition-all); 18 | width: 100%; 19 | &.hamburger { 20 | &-1 { 21 | width: 50%; 22 | } 23 | &-3 { 24 | width: 75%; 25 | } 26 | } 27 | } 28 | 29 | &.active { 30 | .hamburger { 31 | &-1 { 32 | transform-origin: bottom; 33 | transform: rotatez(45deg) translate(13px, 0px); 34 | } 35 | 36 | &-2 { 37 | transform-origin: top; 38 | transform: rotatez(-45deg); 39 | } 40 | 41 | &-3 { 42 | transform-origin: bottom; 43 | width: 50%; 44 | transform: translate(2px, -10px) rotatez(45deg); 45 | } 46 | } 47 | } 48 | 49 | @include respond-to('md') { 50 | display: none; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /packages/utils/private/render.ts: -------------------------------------------------------------------------------- 1 | import { h, withDirectives } from 'vue' 2 | 3 | export function hSlot(slot, otherwise?) { 4 | return slot !== void 0 ? slot() : otherwise 5 | } 6 | 7 | export function hUniqueSlot(slot, otherwise) { 8 | return slot !== void 0 ? slot().slice() : otherwise 9 | } 10 | 11 | /** 12 | * Source definitely exists, 13 | * so it's merged with the possible slot 14 | */ 15 | export function hMergeSlot(slot, source) { 16 | return slot !== void 0 ? source.concat(slot()) : source 17 | } 18 | 19 | /** 20 | * Merge with possible slot, 21 | * even if source might not exist 22 | */ 23 | export function hMergeSlotSafely(slot, source) { 24 | if (slot === void 0) { 25 | return source 26 | } 27 | 28 | return source !== void 0 ? source.concat(slot()) : slot() 29 | } 30 | 31 | /* 32 | * (String) key - unique vnode key 33 | * (Boolean) condition - should change ONLY when adding/removing directive 34 | */ 35 | export function hDir(tag, data, children?, key?, condition?, getDirsFn?) { 36 | data.key = key + condition 37 | 38 | const vnode = h(tag, data, children) 39 | 40 | return condition === true ? withDirectives(vnode, getDirsFn()) : vnode 41 | } 42 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcScanLineMaterial.ts: -------------------------------------------------------------------------------- 1 | export default ` 2 | uniform vec4 color; 3 | uniform float globalAlpha; 4 | uniform float speed; 5 | 6 | float circle(vec2 uv, float r, float blur) { 7 | float d = length(uv) * 2.0; 8 | float c = smoothstep(r + blur, r, d); 9 | return c; 10 | } 11 | 12 | czm_material czm_getMaterial(czm_materialInput materialInput) { 13 | czm_material material = czm_getDefaultMaterial(materialInput); 14 | vec2 st = materialInput.st - 0.5; 15 | material.diffuse = color.rgb; 16 | material.emission = vec3(0); 17 | 18 | float t = fract(czm_frameNumber * speed / 1000.0); 19 | float s = 0.3; 20 | float radiusVC = smoothstep(0.0, s, t) * 0.9; 21 | float alpha1 = circle(st, radiusVC, 0.01) * circle(st, radiusVC, -0.01); 22 | float alpha2 = circle(st, radiusVC, 0.01 - radiusVC) * circle(st, radiusVC, 0.01); 23 | float radius2 = 0.5 + smoothstep(s, 1.0, t) * 0.5; 24 | float alpha3 = circle(st, radiusVC, radius2 + 0.01 - radiusVC) * circle(st, radiusVC, -0.01); 25 | 26 | material.alpha = smoothstep(1.0, s, t) * (alpha1 + alpha2 * 0.1 + alpha3 * 0.1); 27 | material.alpha *= color.a * globalAlpha; 28 | 29 | return material; 30 | } 31 | ` 32 | -------------------------------------------------------------------------------- /docs/.vitepress/plugins/api-table.ts: -------------------------------------------------------------------------------- 1 | import type { MarkdownRenderer } from 'vitepress' 2 | 3 | export function ApiTableContainer(md: MarkdownRenderer) { 4 | const fence = md.renderer.rules.fence! 5 | 6 | md.renderer.rules.fence = (...args) => { 7 | const [tokens, idx, ...rest] = args 8 | const [options, env] = rest 9 | const token = tokens[idx] 10 | if (token.info === 'api') { 11 | const newTokens = md.parse(token.content, env) 12 | 13 | let result = '' 14 | const { rules } = md.renderer 15 | newTokens.forEach((newToken, idx) => { 16 | const { type } = newToken 17 | if (type === 'inline') { 18 | result += md.renderer.renderInline(newToken.children!, options, env) 19 | } 20 | else if (typeof rules[type] !== 'undefined') { 21 | result += rules[newToken.type]!( 22 | newTokens, 23 | idx, 24 | options, 25 | env, 26 | md.renderer 27 | ) 28 | } 29 | else { 30 | result += md.renderer.renderToken(newTokens, idx, options) 31 | } 32 | }) 33 | return result 34 | } 35 | return fence.call(md, ...args) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/shared/extends/materials/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-06-12 20:29:59 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-22 12:44:05 7 | * @FilePath: \vue-cesium\packages\shared\extends\materials\index.ts 8 | */ 9 | import MaterialExtend from './MaterialExtend' 10 | import VcCircleWaveMaterialProperty from './VcCircleWaveMaterialProperty' 11 | import VcLineFlowColorMaterialProperty from './VcLineFlowColorMaterialProperty' 12 | import VcLineFlowMaterialProperty from './VcLineFlowMaterialProperty' 13 | import VcLineTrailColorMaterialProperty from './VcLineTrailColorMaterialProperty' 14 | import VcLineTrailMaterialProperty from './VcLineTrailMaterialProperty' 15 | import VcODLineMaterialProperty from './VcODLineMaterialProperty' 16 | import VcScanLineMaterialProperty from './VcScanLineMaterialProperty' 17 | 18 | export { 19 | MaterialExtend, 20 | VcCircleWaveMaterialProperty, 21 | VcLineFlowColorMaterialProperty, 22 | VcLineFlowMaterialProperty, 23 | VcLineTrailColorMaterialProperty, 24 | VcLineTrailMaterialProperty, 25 | VcODLineMaterialProperty, 26 | VcScanLineMaterialProperty 27 | } 28 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/main-color.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 36 | -------------------------------------------------------------------------------- /packages/theme-default/src/images/vc-compass-rotation-marker.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | compass-rotation-marker 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/useDynamicClass.ts: -------------------------------------------------------------------------------- 1 | import { onMounted, onUnmounted } from 'vue' 2 | 3 | export interface DynamicClassOptions { 4 | prefix?: string 5 | length?: number 6 | } 7 | 8 | export function useDynamicClass( 9 | cssRulesFactory: (className: string) => string, 10 | options: DynamicClassOptions = {} 11 | ) { 12 | const { prefix = 'doc-content-', length = 9 } = options 13 | 14 | const generateRandomString = (len: number): string => { 15 | return Array.from({ length: len }, () => 16 | String.fromCharCode(97 + Math.floor(Math.random() * 26))).join('') 17 | } 18 | 19 | const className = `${prefix}${generateRandomString(length)}` 20 | 21 | let styleElement: HTMLStyleElement | null = null 22 | 23 | onMounted(() => { 24 | styleElement = document.createElement('style') 25 | const cssRules = cssRulesFactory(className) 26 | styleElement.textContent = cssRules 27 | document.head.appendChild(styleElement) 28 | }) 29 | 30 | onUnmounted(() => { 31 | if (styleElement && styleElement.parentNode) { 32 | styleElement.parentNode.removeChild(styleElement) 33 | } 34 | }) 35 | 36 | return { 37 | className, 38 | dynamicClass: className 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/vp-content.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 35 | -------------------------------------------------------------------------------- /docs/zh-CN/component/config-provider.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 全局配置 3 | lang: zh-CN 4 | --- 5 | 6 | # Config Provider 全局配置 7 | 8 | Config Provider 被用来提供全局的配置选项,让你的配置能够在全局都能够被访问到。 9 | 10 | ## i18n 配置 11 | 12 | 通过 Config Provider 来配置多语言,让你的应用可以随时切换语言。 13 | 14 | :::demo 使用两个属性来提供 i18n 相关配置 15 | 16 | config-provider/usage 17 | 18 | ::: 19 | 20 | ## API 21 | 22 | ### Props 23 | 24 | 25 | | 属性名 | 类型 | 默认值 | 描述 | 26 | | ----------- | ------------------ | --------------------------------------------------------------------------------- | ----------------------------- | 27 | | locale | | [Chinese](https://github.com/zouyaoji/vue-cesium/blob/dev/packages/locale/lang/zh-cn.ts) | `optional` 翻译文本对象。 | 28 | | cesiumPath | string | `'https://unpkg.com/cesium@latest/Build/Cesium/Cesium.js'` | `optional` CesiumJS 地址。 | 29 | | accessToken | string | `'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OGE2MjZlOC1mMzhiLTRkZjQtOWEwZi1jZTE0MWY0YzhlMTAiLCJpZCI6MjU5LCJpYXQiOjE2NDM3MjU1NzZ9.ptZ5tVXvMmuWRC0WhjtYTg-17nQh14fgxBsx0HJiVXQ'` | `optional` 指定 accessToken。 | 30 | 31 | ### Slots 32 | 33 | | 名称 | 说明 | 34 | | ------- | --------------------------------- | 35 | | default | vc-config-provider 组件默认插槽。 | 36 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcLineTrailColorMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-08-17 00:10:56 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2024-06-23 18:39:05 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcLineTrailColorMaterial.ts 8 | */ 9 | 10 | export default ` 11 | uniform vec4 bgColor; 12 | uniform vec4 color; 13 | uniform float speed; 14 | uniform float globalAlpha; 15 | 16 | czm_material czm_getMaterial(czm_materialInput materialInput) { 17 | czm_material material = czm_getDefaultMaterial(materialInput); 18 | vec2 st = materialInput.st; 19 | float time = fract(czm_frameNumber * speed / 1000.0); 20 | 21 | vec3 colorMars3D = color.rgb; 22 | if(st.t > 0.45 && st.t < 0.55) { 23 | colorMars3D = vec3(1.0); 24 | } 25 | material.alpha = color.a * 1.5 * smoothstep(0.0, 1.0, fract(st.s - time)); 26 | material.diffuse = max(colorMars3D.rgb * material.alpha, colorMars3D.rgb); 27 | 28 | if(material.alpha < bgColor.a) { 29 | material.alpha = bgColor.a; 30 | material.diffuse = bgColor.rgb; 31 | } 32 | material.alpha = material.alpha * globalAlpha; 33 | 34 | return material; 35 | } 36 | ` 37 | -------------------------------------------------------------------------------- /packages/theme-default/src/index.scss: -------------------------------------------------------------------------------- 1 | @import './helpers/string.scss'; 2 | @import './helpers/math.scss'; 3 | 4 | @import './core/variables.scss'; 5 | @import './core/mixins.scss'; 6 | @import './core/normalize.scss'; 7 | 8 | @import './ajax-bar.scss'; 9 | @import './tooltip.scss'; 10 | @import './icon.scss'; 11 | @import './spinner.scss'; 12 | @import './btn.scss'; 13 | @import './fab.scss'; 14 | @import './skeleton.scss'; 15 | @import './slider.scss'; 16 | 17 | @import './navigation.scss'; 18 | @import './navigation-sm.scss'; 19 | @import './compass.scss'; 20 | @import './zoom-control.scss'; 21 | @import './print.scss'; 22 | @import './my-location.scss'; 23 | @import './status-bar.scss'; 24 | @import './distance-legend.scss'; 25 | @import './html-overlay.scss'; 26 | @import './echart-overlay.scss'; 27 | @import './measurements.scss'; 28 | @import './drawings.scss'; 29 | @import './overview.scss'; 30 | @import './selection-indicator.scss'; 31 | @import './typhoon.scss'; 32 | 33 | @import './core/flex.scss'; 34 | @import './core/positioning.scss'; 35 | @import './core/visibility.scss'; 36 | @import './core/ripple.scss'; 37 | @import './core/mouse.scss'; 38 | @import './core/colors.scss'; 39 | @import './core/touch.scss'; 40 | @import './core/size.scss'; 41 | -------------------------------------------------------------------------------- /packages/vue-cesium/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-cesium", 3 | "version": "3.0.10", 4 | "description": "Vue 3.x components for CesiumJS.", 5 | "author": "zouyaoji <370681295@qq.com>", 6 | "homepage": "https://github.com/zouyaoji/vue-cesium#readme", 7 | "keywords": [ 8 | "vue-cesium", 9 | "cesium", 10 | "webgl", 11 | "gis", 12 | "vue", 13 | "webgis" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/zouyaoji/vue-cesium.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 21 | }, 22 | "license": "MIT", 23 | "peerDependencies": { 24 | "vue": "^3.5.0" 25 | }, 26 | "dependencies": { 27 | "@amap/amap-jsapi-loader": "^1.0.1", 28 | "@turf/circle": "^7.3.0", 29 | "@vue/shared": "^3.5.24", 30 | "@zouyaoji/heatmap.js": "^2.0.8", 31 | "compare-versions": "^6.1.1", 32 | "echarts": "^6.0.0", 33 | "kdbush": "^4.0.2", 34 | "lodash": "^4.17.21", 35 | "lodash-es": "^4.17.21", 36 | "lodash-unified": "^1.0.3", 37 | "mitt": "^3.0.1", 38 | "proj4": "^2.20.2", 39 | "urijs": "^1.19.11" 40 | }, 41 | "browserslist": [ 42 | "> 1%", 43 | "not ie 11", 44 | "not op_mini all" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /packages/utils/private/format.ts: -------------------------------------------------------------------------------- 1 | const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] 2 | 3 | export function humanStorageSize(bytes) { 4 | let u = 0 5 | 6 | while (Number.parseInt(bytes, 10) >= 1024 && u < units.length - 1) { 7 | bytes /= 1024 8 | ++u 9 | } 10 | 11 | return `${bytes.toFixed(1)}${units[u]}` 12 | } 13 | 14 | export function capitalize(str) { 15 | return str.charAt(0).toUpperCase() + str.slice(1) 16 | } 17 | 18 | export function between(v, min, max) { 19 | return max <= min ? min : Math.min(max, Math.max(min, v)) 20 | } 21 | 22 | export function normalizeToInterval(v, min, max) { 23 | if (max <= min) { 24 | return min 25 | } 26 | 27 | const size = max - min + 1 28 | 29 | let index = min + ((v - min) % size) 30 | if (index < min) { 31 | index = size + index 32 | } 33 | 34 | return index === 0 ? 0 : index // fix for (-a % a) => -0 35 | } 36 | 37 | export function pad(v, length = 2, char = '0') { 38 | if (v === void 0 || v === null) { 39 | return v 40 | } 41 | 42 | const val = `${v}` 43 | return val.length >= length ? val : Array.from({ length: length - val.length + 1 }).join(char) + val 44 | } 45 | 46 | export default { 47 | humanStorageSize, 48 | capitalize, 49 | between, 50 | normalizeToInterval, 51 | pad 52 | } 53 | -------------------------------------------------------------------------------- /packages/theme-default/src/spinner.scss: -------------------------------------------------------------------------------- 1 | @import './core/variables.scss'; 2 | 3 | .vc-spinner { 4 | vertical-align: middle; 5 | } 6 | 7 | .vc-spinner-mat { 8 | // animation: vc-spin 2s linear infinite; 9 | // transform-origin: center center; 10 | 11 | .path { 12 | stroke-dasharray: 13 | 1, 14 | 200 #{'/* rtl:ignore */'}; 15 | stroke-dashoffset: 0 #{'/* rtl:ignore */'}; 16 | animation: vc-mat-dash 1.5s ease-in-out infinite; 17 | } 18 | } 19 | 20 | @keyframes vc-spin { 21 | 0% { 22 | transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'}; 23 | } 24 | 25 | 25% { 26 | transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'}; 27 | } 28 | 29 | 50% { 30 | transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'}; 31 | } 32 | 33 | 75% { 34 | transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'}; 35 | } 36 | 37 | 100% { 38 | transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'}; 39 | } 40 | } 41 | 42 | @keyframes vc-mat-dash { 43 | 0% { 44 | stroke-dasharray: 1, 200; 45 | stroke-dashoffset: 0; 46 | } 47 | 48 | 50% { 49 | stroke-dasharray: 89, 200; 50 | stroke-dashoffset: -35px; 51 | } 52 | 53 | 100% { 54 | stroke-dasharray: 89, 200; 55 | stroke-dashoffset: -124px; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/composables/use-toc.ts: -------------------------------------------------------------------------------- 1 | import type { PageData } from 'vitepress' 2 | import { useData } from 'vitepress' 3 | 4 | import { computed } from 'vue' 5 | 6 | type EnhanceArrayElement = T extends Array ? (U & P)[] : never 7 | 8 | type Headers = EnhanceArrayElement< 9 | PageData['headers'], 10 | { 11 | children?: Headers 12 | } 13 | > 14 | 15 | export function useToc() { 16 | const { page } = useData() 17 | 18 | return computed(() => resolveHeaders(page.value.headers)) 19 | } 20 | 21 | export function resolveHeaders(headers: PageData['headers']) { 22 | return mapHeaders(groupHeaders(headers)) 23 | } 24 | 25 | export function groupHeaders(headers: PageData['headers']) { 26 | headers = headers.map(h => Object.assign({}, h)) 27 | let lastH2 28 | 29 | headers.forEach((h) => { 30 | if (h.level === 2) { 31 | lastH2 = h 32 | } 33 | else if (lastH2) { 34 | ;(lastH2.children || (lastH2.children = [])).push(h) 35 | } 36 | }) 37 | return headers.filter(h => h.level === 2) 38 | } 39 | 40 | export function mapHeaders(headers: Headers) { 41 | return headers.map(header => ({ 42 | text: header.title, 43 | link: `#${header.slug}`, 44 | children: header.children ? mapHeaders(header.children) : undefined 45 | })) 46 | } 47 | -------------------------------------------------------------------------------- /packages/theme-default/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-cesium/theme-default", 3 | "version": "3.0.2-beta.8", 4 | "description": "VueCesium default theme.", 5 | "main": "index.css", 6 | "unpkg": "index.css", 7 | "jsdelivr": "index.css", 8 | "style": "index.css", 9 | "license": "MIT", 10 | "scripts": { 11 | "clean": "rimraf dist", 12 | "build": "node --require tsx/cjs node_modules/gulp-cli/bin/gulp.js" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/zouyaoji/vue-cesium/issues" 16 | }, 17 | "homepage": "https://zouyaoji.top/vue-cesium", 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com:zouyaoji/vue-cesium.git" 21 | }, 22 | "devDependencies": { 23 | "@vue-cesium/build": "workspace:*", 24 | "@types/gulp-autoprefixer": "^0.0.37", 25 | "@types/gulp-postcss": "^8.0.6", 26 | "@types/gulp-rename": "^2.0.7", 27 | "@types/gulp-sass": "^6.0.0", 28 | "cssnano": "^7.1.2", 29 | "gulp": "^5.0.1", 30 | "gulp-autoprefixer": "^10.0.0", 31 | "gulp-cli": "^3.1.0", 32 | "gulp-postcss": "^10.0.0", 33 | "gulp-rename": "^2.0.0", 34 | "gulp-sass": "^6.0.1", 35 | "postcss": "^8.5.6", 36 | "postcss-import": "^16.1.1", 37 | "postcss-url": "^10.1.3", 38 | "sass": "^1.94.2", 39 | "tsx": "^4.20.6" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | import type { Theme } from 'vitepress' 2 | import { isClient } from '@vueuse/core' 3 | import ElementPlus, { 4 | ID_INJECTION_KEY, 5 | ZINDEX_INJECTION_KEY 6 | } from 'element-plus' 7 | import VueCesium from 'vue-cesium' 8 | import { define } from '../utils/types' 9 | import VPApp, { globals, NotFound } from '../vitepress' 10 | import 'uno.css' 11 | import './style.css' 12 | import 'vitepress/dist/client/theme-default/styles/components/vp-code-group.css' 13 | import 'virtual:group-icons.css' 14 | // 本地 15 | // import '@vue-cesium/theme-default/src/index.scss' 16 | // npm 17 | import 'vue-cesium/dist/index.css' 18 | import './normalize.scss' 19 | import './demo.scss' 20 | 21 | export default define({ 22 | NotFound, 23 | Layout: VPApp, 24 | enhanceApp: async ({ app, router }) => { 25 | app.use(ElementPlus) 26 | app.use(VueCesium) 27 | app.provide(ID_INJECTION_KEY, { prefix: 1024, current: 0 }) 28 | app.provide(ZINDEX_INJECTION_KEY, { current: 0 }) 29 | Object.entries(globals).forEach(([name, Comp]) => { 30 | app.component(name, Comp) 31 | }) 32 | if (!isClient) 33 | return 34 | const nprogress = await import('nprogress') 35 | router.onBeforeRouteChange = nprogress.start 36 | router.onAfterRouteChange = nprogress.done 37 | } 38 | }) 39 | -------------------------------------------------------------------------------- /docs/.vitepress/vitepress/components/globals/contributors.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 39 | 40 | 49 | -------------------------------------------------------------------------------- /packages/components/controls/distance-legend/defaultProps.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2021-10-27 15:54:13 4 | * @LastEditTime: 2022-08-19 22:38:20 5 | * @LastEditors: zouyaoji 6 | * @Description: 7 | * @FilePath: \vue-cesium@next\packages\components\controls\distance-legend\defaultProps.ts 8 | */ 9 | import type { PropType } from 'vue' 10 | 11 | export default { 12 | position: { 13 | type: String as PropType<'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top' | 'right' | 'bottom' | 'left'>, 14 | default: 'bottom-right', 15 | validator: (v: string) => ['top-right', 'top-left', 'bottom-right', 'bottom-left', 'top', 'right', 'bottom', 'left'].includes(v) 16 | }, 17 | offset: { 18 | type: Array as PropType as PropType<[number, number]>, 19 | validator: v => v.length === 2 20 | }, 21 | color: { 22 | type: String, 23 | default: '#fff' 24 | }, 25 | background: { 26 | type: String, 27 | default: '#3f4854' 28 | }, 29 | width: { 30 | type: Number, 31 | default: 100 32 | }, 33 | barBackground: { 34 | type: String, 35 | default: '#fff' 36 | }, 37 | customClass: { 38 | type: String, 39 | default: '' 40 | }, 41 | teleportToViewer: { 42 | type: Boolean, 43 | default: true 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/composables/use-geometries/index.ts: -------------------------------------------------------------------------------- 1 | import type { VcGeometryInstanceRef } from '@vue-cesium/components' 2 | /* 3 | * @Author: zouyaoji@https://github.com/zouyaoji 4 | * @Date: 2021-06-01 18:06:23 5 | * @LastEditTime: 2022-03-11 09:55:22 6 | * @LastEditors: zouyaoji 7 | * @Description: 8 | * @FilePath: \vue-cesium@next\packages\composables\use-geometries\index.ts 9 | */ 10 | import type { VcComponentInternalInstance } from '@vue-cesium/utils/types' 11 | import { getVcParentInstance } from '@vue-cesium/utils/private/vm' 12 | import useCommon from '../use-common' 13 | 14 | export default function (props, ctx, vcInstance: VcComponentInternalInstance) { 15 | // state 16 | vcInstance.cesiumEvents = [] 17 | vcInstance.renderByParent = true 18 | const commonState = useCommon(props, ctx, vcInstance) 19 | 20 | if (commonState === void 0) { 21 | return 22 | } 23 | 24 | // methods 25 | vcInstance.mount = async () => { 26 | const geometry = vcInstance.cesiumObject as Cesium.Geometry 27 | const parentVM = getVcParentInstance(vcInstance).proxy as VcGeometryInstanceRef 28 | return parentVM.__updateGeometry?.(geometry) 29 | } 30 | 31 | return { 32 | transformProps: commonState.transformProps, 33 | unwatchFns: commonState.unwatchFns, 34 | setPropsWatcher: commonState.setPropsWatcher 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/shared/shaders/materials/VcCircleWaveMaterial.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: zouyaoji@https://github.com/zouyaoji 3 | * @Date: 2023-08-18 01:00:48 4 | * @Description: Do not edit 5 | * @LastEditors: zouyaoji 370681295@qq.com 6 | * @LastEditTime: 2023-08-18 01:01:56 7 | * @FilePath: \vue-cesium\packages\shared\shaders\materials\VcCircleWaveMaterial.ts 8 | */ 9 | export default ` 10 | czm_material czm_getMaterial(czm_materialInput materialInput) { 11 | czm_material material = czm_getDefaultMaterial(materialInput); 12 | material.diffuse = 1.5 * color.rgb; 13 | vec2 st = materialInput.st; 14 | vec3 str = materialInput.str; 15 | float dis = distance(st, vec2(0.5, 0.5)); 16 | float per = fract(time); 17 | if (abs(str.z) > 0.001) { 18 | discard; 19 | } 20 | if (dis > 0.5) { 21 | discard; 22 | } else { 23 | float perDis = 0.5 / count; 24 | float disNum; 25 | float bl = .0; 26 | for (int i = 0; i <= 9; i++) { 27 | if (float(i) <= count) { 28 | disNum = perDis *float(i) - dis + per / count; 29 | if (disNum > 0.0) { 30 | if (disNum < perDis) { 31 | bl = 1.0 - disNum / perDis; 32 | } else if(disNum - perDis < perDis) { 33 | bl = 1.0 - abs(1.0 - disNum / perDis); 34 | } 35 | material.alpha = pow(bl, gradient); 36 | } 37 | } 38 | } 39 | } 40 | return material; 41 | }` 42 | --------------------------------------------------------------------------------