{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/providers/grid/index.ts"],"sourcesContent":["/*\n * @Author: zouyaoji@https://github.com/zouyaoji\n * @Date: 2021-09-16 09:28:13\n * @LastEditTime: 2022-04-08 13:42:06\n * @LastEditors: zouyaoji\n * @Description:\n * @FilePath: \\vue-cesium@next\\packages\\components\\providers\\grid\\index.ts\n */\nimport type { PropType } from 'vue'\nimport type { VcColor, VcComponentInternalInstance, VcComponentPublicInstance, VcImageryProvider, VcReadyObject } from '@vue-cesium/utils/types'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport { useProviders } from '@vue-cesium/composables'\nimport { tilingScheme, ellipsoid, tileWidth, tileHeight, glowColor } from '@vue-cesium/utils/cesium-props'\nimport { makeColor } from '@vue-cesium/utils/cesium-helpers'\nimport { kebabCase } from '@vue-cesium/utils/util'\nimport { providerEmits } from '@vue-cesium/utils/emits'\n\nexport const gridImageryProviderProps = {\n  ...tilingScheme,\n  ...ellipsoid,\n  cells: {\n    type: Number,\n    default: 8\n  },\n  color: {\n    type: [String, Object, Array] as PropType<VcColor>,\n    default: () => [1.0, 1.0, 1.0, 0.4],\n    watcherOptions: {\n      cesiumObjectBuilder: makeColor\n    }\n  },\n  ...glowColor,\n  glowWidth: {\n    type: Number,\n    default: 6\n  },\n  backgroundColor: {\n    type: [String, Array, Object] as PropType<VcColor>,\n    default: () => [0.0, 0.5, 0.0, 0.2],\n    watcherOptions: {\n      cesiumObjectBuilder: makeColor\n    }\n  },\n  ...tileWidth,\n  ...tileHeight,\n  canvasSize: {\n    type: Number,\n    default: 256\n  }\n}\nexport default defineComponent({\n  name: 'VcImageryProviderGrid',\n  props: gridImageryProviderProps,\n  emits: providerEmits,\n  setup(props, ctx) {\n    // state\n    const instance = getCurrentInstance() as VcComponentInternalInstance\n    instance.cesiumClass = 'GridImageryProvider'\n    useProviders(props, ctx, instance)\n    return () => createCommentVNode(kebabCase(instance.proxy?.$options.name || ''))\n  }\n})\n\nexport type VcImageryProviderGridProps = {\n  /**\n   * The tiling scheme for which to draw tiles.\n   */\n  tileScheme?: Cesium.GeographicTilingScheme | Cesium.WebMercatorTilingScheme\n  /**\n   * The ellipsoid. If the tilingScheme is specified, 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 number of grids cells.\n   * Default value: 8\n   */\n  cells?: number\n  /**\n   * The color to draw grid lines.\n   * Default value: [1.0, 1.0, 1.0, 0.4]\n   */\n  color?: VcColor\n  /**\n   * The color to draw glow for grid lines.\n   * Default value: [0.0, 1.0, 0.0, 0.05]\n   */\n  glowColor?: VcColor\n  /**\n   * The width of lines used for rendering the line glow effect.\n   * Default value: 6\n   */\n  glowWidth?: number\n  /**\n   * Background fill color.\n   * Default value: [0.0, 0.5, 0.0, 0.2]\n   */\n  backgroundColor?: VcColor\n  /**\n   * The width of the tile for level-of-detail selection purposes.\n   * Default value: 256\n   */\n  tileWidth?: number\n  /**\n   * The height of the tile for level-of-detail selection purposes.\n   * Default value: 256\n   */\n  tileHeight?: number\n  /**\n   * The size of the canvas used for rendering.\n   * Default value: 256\n   */\n  canvasSize?: number\n  /**\n   * Triggers before the VcImageryProviderGrid is loaded.\n   */\n  onBeforeLoad?: (instance: VcComponentInternalInstance) => void\n  /**\n   * Triggers when the VcImageryProviderGrid 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 VcImageryProviderGrid 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 VcImageryProviderGridR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