casc-cesium
Version:
Vue 3.x components for CesiumJS.
1 lines • 4.46 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/osm/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 13:43:58\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\osm\\index.ts\n */\nimport type { PropType } from 'vue'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject, VcRectangle } from 'casc-cesium-utils/types'\nimport { useProviders } from 'casc-cesium-composables'\nimport { fileExtension, rectangle, minimumLevel, maximumLevel, ellipsoid } from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { providerEmits } from 'casc-cesium-utils/emits'\n\nexport const osmImageryProviderProps = {\n url: {\n type: String,\n default: 'https://a.tile.openstreetmap.org'\n },\n ...fileExtension,\n ...rectangle,\n ...minimumLevel,\n ...maximumLevel,\n ...ellipsoid,\n credit: {\n type: [String, Object] as PropType<string | Cesium.Credit>,\n default: 'MapQuest, Open Street Map and contributors, CC-BY-SA'\n }\n}\nexport default defineComponent({\n name: 'VcImageryProviderOsm',\n props: osmImageryProviderProps,\n emits: providerEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'OpenStreetMapImageryProvider'\n useProviders(props, ctx, instance)\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n }\n})\n\nexport type VcImageryProviderOsmProps = {\n /**\n * The OpenStreetMap server url.\n * Default value: 'https://a.tile.openstreetmap.org'\n */\n url?: string\n /**\n * The file extension for images on the server.\n * Default value: 'png'\n */\n fileExtension?: string\n /**\n * The rectangle of the layer.\n */\n rectangle?: VcRectangle\n /**\n * The minimum level-of-detail supported by the imagery provider.\n * Default value: 0\n */\n minimumLevel?: number\n /**\n * The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.\n */\n maximumLevel?: number\n /**\n * The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n */\n ellipsoid?: Cesium.Ellipsoid\n /**\n * A credit for the data source, which is displayed on the canvas.\n * Default value: 'MapQuest, Open Street Map and contributors, CC-BY-SA'\n */\n credit?: string | Cesium.Credit\n /**\n * Triggers before the VcImageryProviderOsm is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcImageryProviderOsm 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 VcImageryProviderOsm 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 VcImageryProviderOsmRef = VcComponentPublicInstance<VcImageryProviderOsmProps>\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,uBAAuB,GAAG;AACvC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,kCAAkC;AAC/C,GAAG;AACH,EAAE,GAAG,aAAa;AAClB,EAAE,GAAG,SAAS;AACd,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,YAAY;AACjB,EAAE,GAAG,SAAS;AACd,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,sDAAsD;AACnE,GAAG;AACH,EAAE;AACF,yBAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,sBAAsB;AAC9B,EAAE,KAAK,EAAE,uBAAuB;AAChC,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,8BAA8B,CAAC;AAC1D,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;;;;"}