{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/mapbox-style/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:39\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\mapbox-style\\index.ts\n */\nimport type { PropType } from 'vue'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport type { VcComponentInternalInstance, VcComponentPublicInstance, VcReadyObject, VcRectangle } from '@vue-cesium/utils/types'\nimport { useProviders } from '@vue-cesium/composables'\nimport { accessToken, ellipsoid, minimumLevel, maximumLevel, rectangle, credit } from '@vue-cesium/utils/cesium-props'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { providerEmits } from '@vue-cesium/utils/emits'\n\nexport const mapboxImageryProviderProps = {\n  url: {\n    type: [String, Object] as PropType<string | Cesium.Resource>,\n    default: 'https://api.mapbox.com/styles/v1/'\n  },\n  username: {\n    type: String,\n    default: 'mapbox'\n  },\n  styleId: String,\n  ...accessToken,\n  tilesize: {\n    type: Number,\n    default: 512\n  },\n  scaleFactor: Boolean,\n  ...ellipsoid,\n  ...minimumLevel,\n  ...maximumLevel,\n  ...rectangle,\n  ...credit\n}\nexport default defineComponent({\n  name: 'VcImageryProviderMapbox',\n  props: mapboxImageryProviderProps,\n  emits: providerEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'MapboxStyleImageryProvider'\n    useProviders(props, ctx, instance)\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n  }\n})\n\nexport type VcImageryProviderMapboxProps = {\n  /**\n   * The Mapbox server url.\n   * Default value: 'https://api.mapbox.com/v4/'\n   */\n  url?: string | Cesium.Resource\n  /**\n   * The username of the map account.\n   * Default value: 'mapbox'\n   */\n  username?: string\n  /**\n   * The Mapbox Style ID.\n   */\n  styleId?: string\n  /**\n   * The public access token for the imagery.\n   */\n  accessToken?: string\n  /**\n   * The size of the image tiles.\n   * Default value: 512\n   */\n  tilesize?: number\n  /**\n   * Determines if tiles are rendered at a @2x scale factor.\n   */\n  scaleFactor?: boolean\n  /**\n   * The ellipsoid. If not specified, the WGS84 ellipsoid is used.\n   */\n  ellipsoid?: Cesium.Ellipsoid\n  /**\n   * The 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   * A credit for the data source, which is displayed on the canvas.\n   */\n  credit?: string\n  /**\n   * Triggers before the VcImageryProviderMapbox is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcImageryProviderMapbox 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 VcImageryProviderMapbox 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 VcImageryProviderMapboxRef = VcComponentPublicInstance<VcImageryProviderMapboxProps>\n"],"names":[],"mappings":";;;;;;;;AAgBO,MAAM,0BAA6B,GAAA;AAAA,EACxC,GAAK,EAAA;AAAA,IACH,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IACrB,OAAS,EAAA,mCAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,QAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA,MAAA;AAAA,EACT,GAAG,WAAA;AAAA,EACH,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EACA,WAAa,EAAA,OAAA;AAAA,EACb,GAAG,SAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,SAAA;AAAA,EACH,GAAG,MAAA;AACL,EAAA;AACA,4BAAe,eAAgB,CAAA;AAAA,EAC7B,IAAM,EAAA,yBAAA;AAAA,EACN,KAAO,EAAA,0BAAA;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,4BAAA,CAAA;AACvB,IAAa,YAAA,CAAA,KAAA,EAAO,KAAK,QAAQ,CAAA,CAAA;AACjC,IAAA,OAAO,MAAG;AA/Cd,MAAA,IAAA,EAAA,CAAA;AA+CiB,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;;;;"}