{"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 'casc-cesium-utils/types'\nimport { createCommentVNode, defineComponent, getCurrentInstance } from 'vue'\nimport { useProviders } from 'casc-cesium-composables'\nimport { tilingScheme, ellipsoid, tileWidth, tileHeight, glowColor } from 'casc-cesium-utils/cesium-props'\nimport { makeColor } from 'casc-cesium-utils/cesium-helpers'\nimport { kebabCase } from 'casc-cesium-utils/util'\nimport { providerEmits } from 'casc-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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