UNPKG

vue-cesium

Version:
1 lines 5.74 kB
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/tile-map-service/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 13:55:08\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\tile-map-service\\index.ts\n */\nimport type { PropType } from 'vue'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type {\n ProjectionTransforms,\n VcComponentInternalInstance,\n VcComponentPublicInstance,\n VcReadyObject,\n VcRectangle\n} from '@vue-cesium/utils/types'\nimport { useProviders } from '@vue-cesium/composables'\nimport {\n fileExtension,\n credit,\n minimumLevel,\n maximumLevel,\n rectangle,\n tilingScheme,\n ellipsoid,\n tileWidth,\n tileHeight,\n projectionTransforms\n} from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { providerEmits } from '@vue-cesium/utils/emits'\n\nexport const tmsImageryProviderProps = {\n url: [String, Object] as PropType<string | Promise<string> | Promise<Cesium.Resource> | Cesium.Resource>,\n ...fileExtension,\n ...credit,\n ...minimumLevel,\n ...maximumLevel,\n ...rectangle,\n ...tilingScheme,\n ...ellipsoid,\n ...tileWidth,\n ...tileHeight,\n flipXY: Boolean,\n ...projectionTransforms\n}\nexport default defineComponent({\n name: 'VcImageryProviderTms',\n props: tmsImageryProviderProps,\n emits: providerEmits,\n setup(props, ctx) {\n // state\n const instance = getCurrentInstance() as VcComponentInternalInstance\n instance.cesiumClass = 'TileMapServiceImageryProvider'\n useProviders(props, ctx, instance)\n return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n }\n})\n\nexport type VcImageryProviderTmsProps = {\n /**\n * Path to image tiles on server.\n * Default value: '.'\n */\n url?: string | Cesium.Resource | Promise<string> | Promise<Cesium.Resource>\n /**\n * The file extension for images on the server.\n * Default value: 'png'\n */\n fileExtension?: string\n /**\n * A credit for the data source, which is displayed on the canvas.\n * Default value: ''\n */\n credit?: string | Cesium.Credit\n /**\n * \tThe minimum level-of-detail supported by the imagery provider. Take care when specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely to result in rendering problems.\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 rectangle, in radians, covered by the image.\n */\n rectangle?: VcRectangle\n /**\n * The tiling scheme to use to divide the world into tiles. This parameter is ignored when accessing a tiled server.\n */\n tilingScheme?: Cesium.GeographicTilingScheme | Cesium.WebMercatorTilingScheme\n /**\n * The ellipsoid. If the tilingScheme is specified and used, this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither parameter is specified, the WGS84 ellipsoid is used.\n */\n ellipsoid?: Cesium.Ellipsoid\n /**\n * The width of each tile in pixels. This parameter is ignored when accessing a tiled server.\n * Default value: 256\n */\n tileWidth?: number\n /**\n * The height of each tile in pixels. This parameter is ignored when accessing a tiled server.\n * Default value: 256\n */\n tileHeight?: number\n /**\n * Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. Specifying this option will do the same, allowing for loading of these incorrect tilesets.\n */\n flipXY?: boolean\n /**\n * Specify the projection transformation parameters. such as { from: 'BD09', to: 'WGS84' }\n */\n projectionTransforms?: ProjectionTransforms\n /**\n * Triggers before the VcImageryProviderTms is loaded.\n */\n onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n /**\n * Triggers when the VcImageryProviderTms 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 VcImageryProviderTms 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 VcImageryProviderTmsRef = VcComponentPublicInstance<VcImageryProviderTmsProps>\n"],"names":[],"mappings":";;;;;;;;AAiCO,MAAM,uBAA0B,GAAA;AAAA,EACrC,GAAA,EAAK,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpB,GAAG,aAAA;AAAA,EACH,GAAG,MAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,MAAQ,EAAA,OAAA;AAAA,EACR,GAAG,oBAAA;AACL,EAAA;AACA,yBAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,sBAAA;AAAA,EACN,KAAO,EAAA,uBAAA;AAAA,EACP,KAAO,EAAA,aAAA;AAAA,EACP,KAAA,CAAM,OAAO,GAAK,EAAA;AAEhB,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAA,QAAA,CAAS,WAAc,GAAA,+BAAA,CAAA;AACvB,IAAa,YAAA,CAAA,KAAA,EAAO,KAAK,QAAQ,CAAA,CAAA;AACjC,IAAA,OAAO,MAAG;AAxDd,MAAA,IAAA,EAAA,CAAA;AAwDiB,MAAA,OAAA,kBAAA,CAAmB,YAAU,EAAS,GAAA,QAAA,CAAA,KAAA,KAAT,mBAAgB,QAAS,CAAA,IAAA,KAAQ,EAAE,CAAC,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAChF;AACF,CAAC,CAAA;;;;"}