{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/bingmaps/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 11:49:52\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\bingmaps\\index.ts\n */\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type { PropType } from 'vue'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject } from 'casc-cesium-utils/types'\nimport { useProviders } from 'casc-cesium-composables'\nimport { ellipsoid, tileDiscardPolicy } from 'casc-cesium-utils/cesium-props'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { providerEmits } from 'casc-cesium-utils/emits'\n\nexport const bingImageryProviderProps = {\n  url: {\n    type: [String, Object] as PropType<string | Cesium.Resource>,\n    default: 'https://dev.virtualearth.net'\n  },\n  bmKey: String,\n  tileProtocol: String,\n  mapStyle: {\n    type: String as PropType<string | Cesium.BingMapsStyle>,\n    default: 'Aerial'\n  },\n  culture: {\n    type: String,\n    default: ''\n  },\n  ...ellipsoid,\n  ...tileDiscardPolicy\n}\nexport default defineComponent({\n  name: 'VcImageryProviderBing',\n  props: bingImageryProviderProps,\n  emits: providerEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'BingMapsImageryProvider'\n    useProviders(props, ctx, instance)\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n  }\n})\n\nexport type VcImageryProviderBingProps = {\n  /**\n   * The url of the Bing Maps server hosting the imagery.\n   */\n  url: string\n  /**\n   * The Bing Maps key for your application, which can be created at https://www.bingmapsportal.com/. Note that it is bmKey\n   */\n  bmKey?: string\n  /**\n   * The protocol to use when loading tiles, e.g. 'http:' or 'https:'. By default, tiles are loaded using the same protocol as the page.\n   */\n  tileProtocol?: string\n  /**\n   * The type of Bing Maps imagery to load.\n   * Default value: 'Aerial'\n   */\n  mapStyle?: 'Aerial' | 'AerialWithLabels' | 'AerialWithLabelsOnDemand' | 'CanvasDark' | 'CanvasGray' | 'CanvasLight'\n  /**\n   * The culture to use when requesting Bing Maps imagery. Not all cultures are supported. See http://msdn.microsoft.com/en-us/library/hh441729.aspx for information on the supported cultures.\n   */\n  culture?: 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. By default, a DiscardEmptyTileImagePolicy will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy for this parameter.\n   */\n  tileDiscardPolicy?: Cesium.DiscardMissingTileImagePolicy | Cesium.NeverTileDiscardPolicy\n  /**\n   * Triggers before the VcImageryProviderBing is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcImageryProviderBing 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 VcImageryProviderBing 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 VcImageryProviderBingRef = VcComponentPublicInstance<VcImageryProviderBingProps>\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,wBAAwB,GAAG;AACxC,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,8BAA8B;AAC3C,GAAG;AACH,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,YAAY,EAAE,MAAM;AACtB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,SAAS;AACd,EAAE,GAAG,iBAAiB;AACtB,EAAE;AACF,0BAAe,eAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,uBAAuB;AAC/B,EAAE,KAAK,EAAE,wBAAwB;AACjC,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,yBAAyB,CAAC;AACrD,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;;;;"}