casc-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 3.98 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/google-earth/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 13:41:28\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\google-earth\\index.ts\n */\nimport type { PropType } from 'vue'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from 'casc-cesium-utils/types'\nimport { useProviders } from 'casc-cesium-composables'\nimport { url, ellipsoid, tileDiscardPolicy, credit } from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { providerEmits } from 'casc-cesium-utils/emits'\n\nexport const googleImageryProviderProps = {\n ...url,\n ...ellipsoid,\n ...tileDiscardPolicy,\n ...credit,\n metadata: Object as PropType<Cesium.GoogleEarthEnterpriseMetadata>\n}\nexport default defineComponent({\n name: 'VcImageryProviderGoogle',\n props: googleImageryProviderProps,\n emits: providerEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'GoogleEarthEnterpriseImageryProvider'\n useProviders(props, ctx, instance)\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n }\n})\n\nexport type VcImageryProviderGoogleProps = {\n /**\n * The url of the Google Earth Enterprise server hosting the imagery.\n */\n url: string | Cesium.Resource\n /**\n * A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.\n */\n metadata: string\n /**\n * The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n */\n ellipsoid?: Cesium.Ellipsoid\n /**\n * The policy that determines if a tile is invalid and should be discarded. If this value is not specified, a default is to discard tiles that fail to download.\n */\n tileDiscardPolicy?: Cesium.DiscardMissingTileImagePolicy | Cesium.NeverTileDiscardPolicy\n /**\n * A credit for the data source, which is displayed on the canvas.\n */\n credit?: Cesium.Credit | string\n /**\n * Triggers before the VcImageryProviderGoogle is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcImageryProviderGoogle is successfully loaded.\n */\n onReady?: (readyObject: VcReadyObject) => void\n /**\n * Triggers when the component load failed.\n */\n onUnready?: (e: any) => void\n /**\n * Triggers when the VcImageryProviderGoogle is destroyed.\n */\n onDestroyed?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the imagery provider encounters an asynchronous error.\n */\n onErrorEvent?: (evt: Cesium.TileProviderError) => void\n /**\n * Triggers when the provider is ready for use.\n */\n onReadyPromise?: (evt: boolean, viewer: Cesium.Viewer, instance: VcComponentPublicInstance) => void\n}\n\nexport type VcImageryProviderGoogleRef = VcComponentPublicInstance<VcImageryProviderGoogleProps>\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,0BAA0B,GAAG;AAC1C,EAAE,GAAG,GAAG;AACR,EAAE,GAAG,SAAS;AACd,EAAE,GAAG,iBAAiB;AACtB,EAAE,GAAG,MAAM;AACX,EAAE,QAAQ,EAAE,MAAM;AAClB,EAAE;AACF,4BAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,yBAAyB;AACjC,EAAE,KAAK,EAAE,0BAA0B;AACnC,EAAE,KAAK,EAAE,aAAa;AACtB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AAC1C,IAAI,QAAQ,CAAC,WAAW,GAAG,sCAAsC,CAAC;AAClE,IAAI,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AACvC,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC;AAC9G,KAAK,CAAC;AACN,GAAG;AACH,CAAC,CAAC;;;;"}