@movk/maplibre 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.en.md +192 -0
- package/README.md +191 -0
- package/dist/module.d.mts +20 -0
- package/dist/module.d.ts +20 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +63 -0
- package/dist/runtime/components/CustomLayer.d.vue.ts +24 -0
- package/dist/runtime/components/CustomLayer.vue +23 -0
- package/dist/runtime/components/CustomLayer.vue.d.ts +24 -0
- package/dist/runtime/components/Layer.d.vue.ts +75 -0
- package/dist/runtime/components/Layer.vue +112 -0
- package/dist/runtime/components/Layer.vue.d.ts +75 -0
- package/dist/runtime/components/LayerGroup.d.vue.ts +25 -0
- package/dist/runtime/components/LayerGroup.vue +16 -0
- package/dist/runtime/components/LayerGroup.vue.d.ts +25 -0
- package/dist/runtime/components/LottieMarker.d.vue.ts +50 -0
- package/dist/runtime/components/LottieMarker.vue +31 -0
- package/dist/runtime/components/LottieMarker.vue.d.ts +50 -0
- package/dist/runtime/components/Map.d.vue.ts +84 -0
- package/dist/runtime/components/Map.vue +134 -0
- package/dist/runtime/components/Map.vue.d.ts +84 -0
- package/dist/runtime/components/Marker.d.vue.ts +54 -0
- package/dist/runtime/components/Marker.vue +86 -0
- package/dist/runtime/components/Marker.vue.d.ts +54 -0
- package/dist/runtime/components/Popup.d.vue.ts +30 -0
- package/dist/runtime/components/Popup.vue +33 -0
- package/dist/runtime/components/Popup.vue.d.ts +30 -0
- package/dist/runtime/components/Source.d.vue.ts +23 -0
- package/dist/runtime/components/Source.vue +44 -0
- package/dist/runtime/components/Source.vue.d.ts +23 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +45 -0
- package/dist/runtime/components/Tooltip.vue +106 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +45 -0
- package/dist/runtime/components/buffers/BufferCircle.d.vue.ts +27 -0
- package/dist/runtime/components/buffers/BufferCircle.vue +30 -0
- package/dist/runtime/components/buffers/BufferCircle.vue.d.ts +27 -0
- package/dist/runtime/components/buffers/BufferEllipse.d.vue.ts +35 -0
- package/dist/runtime/components/buffers/BufferEllipse.vue +36 -0
- package/dist/runtime/components/buffers/BufferEllipse.vue.d.ts +35 -0
- package/dist/runtime/components/buffers/BufferLine.d.vue.ts +21 -0
- package/dist/runtime/components/buffers/BufferLine.vue +40 -0
- package/dist/runtime/components/buffers/BufferLine.vue.d.ts +21 -0
- package/dist/runtime/components/buffers/BufferPolygon.d.vue.ts +21 -0
- package/dist/runtime/components/buffers/BufferPolygon.vue +40 -0
- package/dist/runtime/components/buffers/BufferPolygon.vue.d.ts +21 -0
- package/dist/runtime/components/buffers/BufferSector.d.vue.ts +31 -0
- package/dist/runtime/components/buffers/BufferSector.vue +35 -0
- package/dist/runtime/components/buffers/BufferSector.vue.d.ts +31 -0
- package/dist/runtime/components/controls/AttributionControl.d.vue.ts +24 -0
- package/dist/runtime/components/controls/AttributionControl.vue +18 -0
- package/dist/runtime/components/controls/AttributionControl.vue.d.ts +24 -0
- package/dist/runtime/components/controls/FullscreenControl.d.vue.ts +24 -0
- package/dist/runtime/components/controls/FullscreenControl.vue +18 -0
- package/dist/runtime/components/controls/FullscreenControl.vue.d.ts +24 -0
- package/dist/runtime/components/controls/GeolocateControl.d.vue.ts +24 -0
- package/dist/runtime/components/controls/GeolocateControl.vue +18 -0
- package/dist/runtime/components/controls/GeolocateControl.vue.d.ts +24 -0
- package/dist/runtime/components/controls/NavigationControl.d.vue.ts +24 -0
- package/dist/runtime/components/controls/NavigationControl.vue +18 -0
- package/dist/runtime/components/controls/NavigationControl.vue.d.ts +24 -0
- package/dist/runtime/components/controls/ScaleControl.d.vue.ts +24 -0
- package/dist/runtime/components/controls/ScaleControl.vue +18 -0
- package/dist/runtime/components/controls/ScaleControl.vue.d.ts +24 -0
- package/dist/runtime/components/effects/AnimatedImage.d.vue.ts +28 -0
- package/dist/runtime/components/effects/AnimatedImage.vue +50 -0
- package/dist/runtime/components/effects/AnimatedImage.vue.d.ts +28 -0
- package/dist/runtime/components/effects/DiffusionCircle.d.vue.ts +44 -0
- package/dist/runtime/components/effects/DiffusionCircle.vue +47 -0
- package/dist/runtime/components/effects/DiffusionCircle.vue.d.ts +44 -0
- package/dist/runtime/components/effects/FlowBuilding.d.vue.ts +53 -0
- package/dist/runtime/components/effects/FlowBuilding.vue +64 -0
- package/dist/runtime/components/effects/FlowBuilding.vue.d.ts +53 -0
- package/dist/runtime/components/effects/GlowCircle.d.vue.ts +44 -0
- package/dist/runtime/components/effects/GlowCircle.vue +42 -0
- package/dist/runtime/components/effects/GlowCircle.vue.d.ts +44 -0
- package/dist/runtime/components/effects/GradientBuilding.d.vue.ts +25 -0
- package/dist/runtime/components/effects/GradientBuilding.vue +37 -0
- package/dist/runtime/components/effects/GradientBuilding.vue.d.ts +25 -0
- package/dist/runtime/components/effects/Migration.d.vue.ts +50 -0
- package/dist/runtime/components/effects/Migration.vue +90 -0
- package/dist/runtime/components/effects/Migration.vue.d.ts +50 -0
- package/dist/runtime/components/effects/Radar.d.vue.ts +32 -0
- package/dist/runtime/components/effects/Radar.vue +49 -0
- package/dist/runtime/components/effects/Radar.vue.d.ts +32 -0
- package/dist/runtime/components/effects/SpriteImage.d.vue.ts +41 -0
- package/dist/runtime/components/effects/SpriteImage.vue +67 -0
- package/dist/runtime/components/effects/SpriteImage.vue.d.ts +41 -0
- package/dist/runtime/components/effects/TextureBuilding.d.vue.ts +25 -0
- package/dist/runtime/components/effects/TextureBuilding.vue +39 -0
- package/dist/runtime/components/effects/TextureBuilding.vue.d.ts +25 -0
- package/dist/runtime/components/effects/Trail.d.vue.ts +44 -0
- package/dist/runtime/components/effects/Trail.vue +61 -0
- package/dist/runtime/components/effects/Trail.vue.d.ts +44 -0
- package/dist/runtime/components/effects/WaveCircle.d.vue.ts +44 -0
- package/dist/runtime/components/effects/WaveCircle.vue +55 -0
- package/dist/runtime/components/effects/WaveCircle.vue.d.ts +44 -0
- package/dist/runtime/components/effects/WindowBuilding.d.vue.ts +53 -0
- package/dist/runtime/components/effects/WindowBuilding.vue +61 -0
- package/dist/runtime/components/effects/WindowBuilding.vue.d.ts +53 -0
- package/dist/runtime/components/environment/Sky.d.vue.ts +21 -0
- package/dist/runtime/components/environment/Sky.vue +15 -0
- package/dist/runtime/components/environment/Sky.vue.d.ts +21 -0
- package/dist/runtime/components/environment/Temperature.d.vue.ts +47 -0
- package/dist/runtime/components/environment/Temperature.vue +41 -0
- package/dist/runtime/components/environment/Temperature.vue.d.ts +47 -0
- package/dist/runtime/components/environment/Terrain.d.vue.ts +34 -0
- package/dist/runtime/components/environment/Terrain.vue +47 -0
- package/dist/runtime/components/environment/Terrain.vue.d.ts +34 -0
- package/dist/runtime/components/extensions/DrawControl.d.vue.ts +0 -0
- package/dist/runtime/components/extensions/DrawControl.vue +168 -0
- package/dist/runtime/components/extensions/DrawControl.vue.d.ts +0 -0
- package/dist/runtime/components/extensions/TiandituLayer.d.vue.ts +20 -0
- package/dist/runtime/components/extensions/TiandituLayer.vue +26 -0
- package/dist/runtime/components/extensions/TiandituLayer.vue.d.ts +20 -0
- package/dist/runtime/components/extensions/WmsLayer.d.vue.ts +50 -0
- package/dist/runtime/components/extensions/WmsLayer.vue +39 -0
- package/dist/runtime/components/extensions/WmsLayer.vue.d.ts +50 -0
- package/dist/runtime/components/extensions/WmtsLayer.d.vue.ts +42 -0
- package/dist/runtime/components/extensions/WmtsLayer.vue +37 -0
- package/dist/runtime/components/extensions/WmtsLayer.vue.d.ts +42 -0
- package/dist/runtime/components/layers/BuildingLayer.d.vue.ts +28 -0
- package/dist/runtime/components/layers/BuildingLayer.vue +41 -0
- package/dist/runtime/components/layers/BuildingLayer.vue.d.ts +28 -0
- package/dist/runtime/components/layers/ClusterLayer.d.vue.ts +55 -0
- package/dist/runtime/components/layers/ClusterLayer.vue +86 -0
- package/dist/runtime/components/layers/ClusterLayer.vue.d.ts +55 -0
- package/dist/runtime/components/layers/ImageLayer.d.vue.ts +21 -0
- package/dist/runtime/components/layers/ImageLayer.vue +25 -0
- package/dist/runtime/components/layers/ImageLayer.vue.d.ts +21 -0
- package/dist/runtime/components/layers/RasterLayer.d.vue.ts +35 -0
- package/dist/runtime/components/layers/RasterLayer.vue +34 -0
- package/dist/runtime/components/layers/RasterLayer.vue.d.ts +35 -0
- package/dist/runtime/components/layers/VideoLayer.d.vue.ts +28 -0
- package/dist/runtime/components/layers/VideoLayer.vue +38 -0
- package/dist/runtime/components/layers/VideoLayer.vue.d.ts +28 -0
- package/dist/runtime/composables/defineMaplibreControl.d.ts +3 -0
- package/dist/runtime/composables/defineMaplibreControl.js +6 -0
- package/dist/runtime/composables/useFeatureState.d.ts +35 -0
- package/dist/runtime/composables/useFeatureState.js +76 -0
- package/dist/runtime/composables/useFrameIcon.d.ts +17 -0
- package/dist/runtime/composables/useFrameIcon.js +36 -0
- package/dist/runtime/composables/useMap.d.ts +3 -0
- package/dist/runtime/composables/useMap.js +9 -0
- package/dist/runtime/composables/useMapAnimation.d.ts +21 -0
- package/dist/runtime/composables/useMapAnimation.js +13 -0
- package/dist/runtime/composables/useMapExport.d.ts +34 -0
- package/dist/runtime/composables/useMapExport.js +35 -0
- package/dist/runtime/composables/useMaplibre.d.ts +6 -0
- package/dist/runtime/composables/useMaplibre.js +4 -0
- package/dist/runtime/composables/useMaplibreCamera.d.ts +15 -0
- package/dist/runtime/composables/useMaplibreCamera.js +32 -0
- package/dist/runtime/composables/useMaplibreDraw.d.ts +10 -0
- package/dist/runtime/composables/useMaplibreDraw.js +34 -0
- package/dist/runtime/composables/useMaplibreImage.d.ts +19 -0
- package/dist/runtime/composables/useMaplibreImage.js +33 -0
- package/dist/runtime/composables/useMeasure.d.ts +25 -0
- package/dist/runtime/composables/useMeasure.js +173 -0
- package/dist/runtime/domains/map/config.d.ts +7 -0
- package/dist/runtime/domains/map/config.js +13 -0
- package/dist/runtime/domains/map/context.d.ts +13 -0
- package/dist/runtime/domains/map/context.js +51 -0
- package/dist/runtime/domains/map/control.d.ts +4 -0
- package/dist/runtime/domains/map/control.js +28 -0
- package/dist/runtime/domains/map/create-map.d.ts +3 -0
- package/dist/runtime/domains/map/create-map.js +21 -0
- package/dist/runtime/domains/map/draw-context.d.ts +26 -0
- package/dist/runtime/domains/map/draw-context.js +73 -0
- package/dist/runtime/domains/map/draw-registry.d.ts +5 -0
- package/dist/runtime/domains/map/draw-registry.js +15 -0
- package/dist/runtime/domains/map/draw-toolbar.d.ts +15 -0
- package/dist/runtime/domains/map/draw-toolbar.js +52 -0
- package/dist/runtime/domains/map/draw.d.ts +4 -0
- package/dist/runtime/domains/map/draw.js +1 -0
- package/dist/runtime/domains/map/layer-group.d.ts +9 -0
- package/dist/runtime/domains/map/layer-group.js +1 -0
- package/dist/runtime/domains/map/registry.d.ts +4 -0
- package/dist/runtime/domains/map/registry.js +10 -0
- package/dist/runtime/domains/map/resolve.d.ts +7 -0
- package/dist/runtime/domains/map/resolve.js +7 -0
- package/dist/runtime/domains/map/style-effect.d.ts +6 -0
- package/dist/runtime/domains/map/style-effect.js +21 -0
- package/dist/runtime/draw-modes/index.d.ts +16 -0
- package/dist/runtime/draw-modes/index.js +32 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/config.d.ts +2 -0
- package/dist/runtime/plugins/config.js +6 -0
- package/dist/runtime/types/draw.d.ts +30 -0
- package/dist/runtime/types/draw.js +0 -0
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/map.d.ts +45 -0
- package/dist/runtime/types/map.js +0 -0
- package/dist/runtime/types/tianditu.d.ts +247 -0
- package/dist/runtime/types/tianditu.js +0 -0
- package/dist/runtime/utils/animated-image.d.ts +13 -0
- package/dist/runtime/utils/animated-image.js +47 -0
- package/dist/runtime/utils/buffer.d.ts +24 -0
- package/dist/runtime/utils/buffer.js +13 -0
- package/dist/runtime/utils/building-effects.d.ts +73 -0
- package/dist/runtime/utils/building-effects.js +50 -0
- package/dist/runtime/utils/building.d.ts +53 -0
- package/dist/runtime/utils/building.js +26 -0
- package/dist/runtime/utils/cluster.d.ts +24 -0
- package/dist/runtime/utils/cluster.js +42 -0
- package/dist/runtime/utils/coordinate.d.ts +12 -0
- package/dist/runtime/utils/coordinate.js +44 -0
- package/dist/runtime/utils/draw-theme.d.ts +47 -0
- package/dist/runtime/utils/draw-theme.js +39 -0
- package/dist/runtime/utils/effects.d.ts +34 -0
- package/dist/runtime/utils/effects.js +78 -0
- package/dist/runtime/utils/events.d.ts +6 -0
- package/dist/runtime/utils/events.js +20 -0
- package/dist/runtime/utils/frame-icon.d.ts +27 -0
- package/dist/runtime/utils/frame-icon.js +45 -0
- package/dist/runtime/utils/geometry.d.ts +5 -0
- package/dist/runtime/utils/geometry.js +41 -0
- package/dist/runtime/utils/heatmap.d.ts +36 -0
- package/dist/runtime/utils/heatmap.js +30 -0
- package/dist/runtime/utils/layer.d.ts +13 -0
- package/dist/runtime/utils/layer.js +17 -0
- package/dist/runtime/utils/logger.d.ts +2 -0
- package/dist/runtime/utils/logger.js +2 -0
- package/dist/runtime/utils/measure.d.ts +4 -0
- package/dist/runtime/utils/measure.js +8 -0
- package/dist/runtime/utils/sprite.d.ts +31 -0
- package/dist/runtime/utils/sprite.js +23 -0
- package/dist/runtime/utils/tianditu-administrative.d.ts +3 -0
- package/dist/runtime/utils/tianditu-administrative.js +48 -0
- package/dist/runtime/utils/tianditu-client.d.ts +30 -0
- package/dist/runtime/utils/tianditu-client.js +17 -0
- package/dist/runtime/utils/tianditu-geocoder.d.ts +5 -0
- package/dist/runtime/utils/tianditu-geocoder.js +37 -0
- package/dist/runtime/utils/tianditu-request.d.ts +20 -0
- package/dist/runtime/utils/tianditu-request.js +42 -0
- package/dist/runtime/utils/tianditu-route.d.ts +3 -0
- package/dist/runtime/utils/tianditu-route.js +40 -0
- package/dist/runtime/utils/tianditu-search.d.ts +15 -0
- package/dist/runtime/utils/tianditu-search.js +183 -0
- package/dist/runtime/utils/tianditu.d.ts +21 -0
- package/dist/runtime/utils/tianditu.js +26 -0
- package/dist/runtime/utils/wms.d.ts +43 -0
- package/dist/runtime/utils/wms.js +30 -0
- package/dist/runtime/utils/wmts.d.ts +35 -0
- package/dist/runtime/utils/wmts.js +29 -0
- package/dist/types.d.mts +5 -0
- package/dist/unplugin.d.mts +30 -0
- package/dist/unplugin.d.ts +30 -0
- package/dist/unplugin.mjs +53 -0
- package/dist/vite.d.mts +7 -0
- package/dist/vite.d.ts +7 -0
- package/dist/vite.mjs +11 -0
- package/dist/vue-plugin.d.mts +9 -0
- package/dist/vue-plugin.d.ts +9 -0
- package/dist/vue-plugin.mjs +9 -0
- package/package.json +174 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BuildingSourceOptions } from '../../utils/building';
|
|
2
|
+
/** 窗户建筑:程序生成窗户点阵贴图 fill-extrusion-pattern。 */
|
|
3
|
+
type __VLS_Props = BuildingSourceOptions & {
|
|
4
|
+
/** 图层 id;省略时自动生成 */
|
|
5
|
+
layerId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 窗户行数
|
|
8
|
+
* @defaultValue 8
|
|
9
|
+
*/
|
|
10
|
+
rows?: number;
|
|
11
|
+
/**
|
|
12
|
+
* 窗户列数
|
|
13
|
+
* @defaultValue 6
|
|
14
|
+
*/
|
|
15
|
+
cols?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 亮窗颜色
|
|
18
|
+
* @defaultValue '#fde68a'
|
|
19
|
+
*/
|
|
20
|
+
litColor?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 暗窗/墙体颜色
|
|
23
|
+
* @defaultValue '#1f2937'
|
|
24
|
+
*/
|
|
25
|
+
darkColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 亮窗比例
|
|
28
|
+
* @defaultValue 0.45
|
|
29
|
+
*/
|
|
30
|
+
litRatio?: number;
|
|
31
|
+
/**
|
|
32
|
+
* 随机种子
|
|
33
|
+
* @defaultValue 1
|
|
34
|
+
*/
|
|
35
|
+
seed?: number;
|
|
36
|
+
/**
|
|
37
|
+
* 整体透明度
|
|
38
|
+
* @defaultValue 1
|
|
39
|
+
*/
|
|
40
|
+
opacity?: number;
|
|
41
|
+
/**
|
|
42
|
+
* 最小缩放级别
|
|
43
|
+
* @defaultValue 15
|
|
44
|
+
*/
|
|
45
|
+
minzoom?: number;
|
|
46
|
+
/** 插入到该图层之前 */
|
|
47
|
+
beforeId?: string;
|
|
48
|
+
};
|
|
49
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
50
|
+
minzoom: number;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SkySpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 天空、地平线、雾与大气混合选项;缺省 {} 使用样式规范默认值
|
|
5
|
+
* @see https://maplibre.org/maplibre-style-spec/sky/
|
|
6
|
+
*/
|
|
7
|
+
options?: SkySpecification;
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useStyleEffect } from "../../domains/map/style-effect";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
options: { type: Object, required: false }
|
|
5
|
+
});
|
|
6
|
+
useStyleEffect(
|
|
7
|
+
() => props.options,
|
|
8
|
+
(map, value) => map.setSky(value ?? {}),
|
|
9
|
+
(map) => map.setSky({})
|
|
10
|
+
);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<slot />
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SkySpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 天空、地平线、雾与大气混合选项;缺省 {} 使用样式规范默认值
|
|
5
|
+
* @see https://maplibre.org/maplibre-style-spec/sky/
|
|
6
|
+
*/
|
|
7
|
+
options?: SkySpecification;
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
/** 温度热力层:GeoJSON 点按温度属性渲染 maplibre 原生 heatmap。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 点要素数据(GeoJSON 或其 URL) */
|
|
5
|
+
data: GeoJSONSourceSpecification['data'];
|
|
6
|
+
/** 图层 id;省略时自动生成 */
|
|
7
|
+
layerId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 权重取值的要素属性
|
|
10
|
+
* @defaultValue 'temperature'
|
|
11
|
+
*/
|
|
12
|
+
weightProperty?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 温度取值范围 [min, max],线性映射到热力权重
|
|
15
|
+
* @defaultValue `[0, 40]`
|
|
16
|
+
*/
|
|
17
|
+
weightRange?: [number, number];
|
|
18
|
+
/** 密度-颜色断点;缺省为蓝→红五档 */
|
|
19
|
+
colorStops?: [number, string][];
|
|
20
|
+
/**
|
|
21
|
+
* 热力半径(像素)
|
|
22
|
+
* @defaultValue 30
|
|
23
|
+
*/
|
|
24
|
+
radius?: number;
|
|
25
|
+
/**
|
|
26
|
+
* 热力强度
|
|
27
|
+
* @defaultValue 1
|
|
28
|
+
*/
|
|
29
|
+
intensity?: number;
|
|
30
|
+
/**
|
|
31
|
+
* 不透明度
|
|
32
|
+
* @defaultValue 1
|
|
33
|
+
*/
|
|
34
|
+
opacity?: number;
|
|
35
|
+
/** 超过该缩放级别隐藏热力(通常切到点图);省略不限制 */
|
|
36
|
+
maxzoom?: number;
|
|
37
|
+
/** 插入到该图层之前 */
|
|
38
|
+
beforeId?: string;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
41
|
+
opacity: number;
|
|
42
|
+
radius: number;
|
|
43
|
+
weightProperty: string;
|
|
44
|
+
intensity: number;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useId } from "vue";
|
|
3
|
+
import { heatmapPaint } from "../../utils/heatmap";
|
|
4
|
+
import MaplibreSource from "../Source.vue";
|
|
5
|
+
import MaplibreLayer from "../Layer.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
data: { type: null, required: true },
|
|
8
|
+
layerId: { type: String, required: false },
|
|
9
|
+
weightProperty: { type: String, required: false, default: "temperature" },
|
|
10
|
+
weightRange: { type: Array, required: false },
|
|
11
|
+
colorStops: { type: Array, required: false },
|
|
12
|
+
radius: { type: Number, required: false, default: 30 },
|
|
13
|
+
intensity: { type: Number, required: false, default: 1 },
|
|
14
|
+
opacity: { type: Number, required: false, default: 1 },
|
|
15
|
+
maxzoom: { type: Number, required: false },
|
|
16
|
+
beforeId: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const id = props.layerId ?? `movk-temperature-${useId()}`;
|
|
19
|
+
const source = computed(() => ({ type: "geojson", data: props.data }));
|
|
20
|
+
const paint = computed(() => heatmapPaint({
|
|
21
|
+
weightProperty: props.weightProperty,
|
|
22
|
+
weightRange: props.weightRange,
|
|
23
|
+
colorStops: props.colorStops,
|
|
24
|
+
radius: props.radius,
|
|
25
|
+
intensity: props.intensity,
|
|
26
|
+
opacity: props.opacity
|
|
27
|
+
}));
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<MaplibreSource :source-id="id" :source="source">
|
|
32
|
+
<MaplibreLayer
|
|
33
|
+
:layer-id="id"
|
|
34
|
+
type="heatmap"
|
|
35
|
+
:source="id"
|
|
36
|
+
:paint="paint"
|
|
37
|
+
:maxzoom="maxzoom"
|
|
38
|
+
:before-id="beforeId"
|
|
39
|
+
/>
|
|
40
|
+
</MaplibreSource>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
/** 温度热力层:GeoJSON 点按温度属性渲染 maplibre 原生 heatmap。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 点要素数据(GeoJSON 或其 URL) */
|
|
5
|
+
data: GeoJSONSourceSpecification['data'];
|
|
6
|
+
/** 图层 id;省略时自动生成 */
|
|
7
|
+
layerId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 权重取值的要素属性
|
|
10
|
+
* @defaultValue 'temperature'
|
|
11
|
+
*/
|
|
12
|
+
weightProperty?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 温度取值范围 [min, max],线性映射到热力权重
|
|
15
|
+
* @defaultValue `[0, 40]`
|
|
16
|
+
*/
|
|
17
|
+
weightRange?: [number, number];
|
|
18
|
+
/** 密度-颜色断点;缺省为蓝→红五档 */
|
|
19
|
+
colorStops?: [number, string][];
|
|
20
|
+
/**
|
|
21
|
+
* 热力半径(像素)
|
|
22
|
+
* @defaultValue 30
|
|
23
|
+
*/
|
|
24
|
+
radius?: number;
|
|
25
|
+
/**
|
|
26
|
+
* 热力强度
|
|
27
|
+
* @defaultValue 1
|
|
28
|
+
*/
|
|
29
|
+
intensity?: number;
|
|
30
|
+
/**
|
|
31
|
+
* 不透明度
|
|
32
|
+
* @defaultValue 1
|
|
33
|
+
*/
|
|
34
|
+
opacity?: number;
|
|
35
|
+
/** 超过该缩放级别隐藏热力(通常切到点图);省略不限制 */
|
|
36
|
+
maxzoom?: number;
|
|
37
|
+
/** 插入到该图层之前 */
|
|
38
|
+
beforeId?: string;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
41
|
+
opacity: number;
|
|
42
|
+
radius: number;
|
|
43
|
+
weightProperty: string;
|
|
44
|
+
intensity: number;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RasterDEMSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 地形夸张系数
|
|
5
|
+
* @defaultValue 1
|
|
6
|
+
*/
|
|
7
|
+
exaggeration?: number;
|
|
8
|
+
/**
|
|
9
|
+
* DEM 数据源,如 Terrarium / Mapbox 编码的 raster-dem 瓦片
|
|
10
|
+
* @see https://maplibre.org/maplibre-style-spec/sources/#raster-dem
|
|
11
|
+
*/
|
|
12
|
+
source: RasterDEMSourceSpecification;
|
|
13
|
+
/**
|
|
14
|
+
* DEM source id
|
|
15
|
+
* @defaultValue 'movk-terrain-dem'
|
|
16
|
+
*/
|
|
17
|
+
sourceId?: string;
|
|
18
|
+
};
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
sourceId: string;
|
|
25
|
+
exaggeration: number;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onUnmounted, watch } from "vue";
|
|
3
|
+
import { useMap } from "../../composables/useMap";
|
|
4
|
+
import { logger } from "../../utils/logger";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
exaggeration: { type: Number, required: false, default: 1 },
|
|
7
|
+
source: { type: Object, required: true },
|
|
8
|
+
sourceId: { type: String, required: false, default: "movk-terrain-dem" }
|
|
9
|
+
});
|
|
10
|
+
const ctx = useMap();
|
|
11
|
+
function apply(map) {
|
|
12
|
+
if (!props.source) {
|
|
13
|
+
logger.warn('MaplibreTerrain: missing required prop "source" (raster-dem source specification).');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!map.getSource(props.sourceId)) {
|
|
17
|
+
map.addSource(props.sourceId, props.source);
|
|
18
|
+
}
|
|
19
|
+
map.setTerrain({ source: props.sourceId, exaggeration: props.exaggeration });
|
|
20
|
+
}
|
|
21
|
+
const stopReady = ctx.onReady(apply);
|
|
22
|
+
watch(() => props.exaggeration, (value) => {
|
|
23
|
+
const map = ctx.map.value;
|
|
24
|
+
if (map?.getSource(props.sourceId)) {
|
|
25
|
+
map.setTerrain({ source: props.sourceId, exaggeration: value });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
onUnmounted(() => {
|
|
29
|
+
stopReady();
|
|
30
|
+
const map = ctx.map.value;
|
|
31
|
+
if (!map) return;
|
|
32
|
+
try {
|
|
33
|
+
map.setTerrain(null);
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
if (map.getSource(props.sourceId)) {
|
|
37
|
+
try {
|
|
38
|
+
map.removeSource(props.sourceId);
|
|
39
|
+
} catch {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<slot />
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RasterDEMSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 地形夸张系数
|
|
5
|
+
* @defaultValue 1
|
|
6
|
+
*/
|
|
7
|
+
exaggeration?: number;
|
|
8
|
+
/**
|
|
9
|
+
* DEM 数据源,如 Terrarium / Mapbox 编码的 raster-dem 瓦片
|
|
10
|
+
* @see https://maplibre.org/maplibre-style-spec/sources/#raster-dem
|
|
11
|
+
*/
|
|
12
|
+
source: RasterDEMSourceSpecification;
|
|
13
|
+
/**
|
|
14
|
+
* DEM source id
|
|
15
|
+
* @defaultValue 'movk-terrain-dem'
|
|
16
|
+
*/
|
|
17
|
+
sourceId?: string;
|
|
18
|
+
};
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
sourceId: string;
|
|
25
|
+
exaggeration: number;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, onUnmounted, provide, watch } from "vue";
|
|
3
|
+
import { TerraDraw } from "terra-draw";
|
|
4
|
+
import { TerraDrawMapLibreGLAdapter } from "terra-draw-maplibre-gl-adapter";
|
|
5
|
+
import { useMap } from "../../composables/useMap";
|
|
6
|
+
import { DrawKey } from "../../domains/map/draw";
|
|
7
|
+
import { addStoreFeatures, committedFeatures, createDrawContext, toStoreFeatures } from "../../domains/map/draw-context";
|
|
8
|
+
import { registerDraw, unregisterDraw } from "../../domains/map/draw-registry";
|
|
9
|
+
import { createDrawToolbar } from "../../domains/map/draw-toolbar";
|
|
10
|
+
import { getMapContext } from "../../domains/map/registry";
|
|
11
|
+
import { movkDrawModes } from "../../draw-modes";
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
position: { type: String, required: false },
|
|
14
|
+
modes: { type: Array, required: false },
|
|
15
|
+
theme: { type: Object, required: false },
|
|
16
|
+
controls: { type: [Boolean, Array], required: false, default: true },
|
|
17
|
+
renderBelowLayerId: { type: String, required: false }
|
|
18
|
+
});
|
|
19
|
+
const emit = defineEmits(["finish", "delete", "select", "deselect", "modechange"]);
|
|
20
|
+
const features = defineModel("features", { type: Array });
|
|
21
|
+
const mode = defineModel("mode", { type: String });
|
|
22
|
+
const ctx = useMap();
|
|
23
|
+
let lastSyncedJson = "";
|
|
24
|
+
let applying = false;
|
|
25
|
+
function applyFeatures(list) {
|
|
26
|
+
lastSyncedJson = JSON.stringify(list);
|
|
27
|
+
features.value = list;
|
|
28
|
+
}
|
|
29
|
+
function applyMode(value) {
|
|
30
|
+
mode.value = value;
|
|
31
|
+
toolbar?.setActive(value);
|
|
32
|
+
emit("modechange", value);
|
|
33
|
+
}
|
|
34
|
+
const { context: drawContext, attach } = createDrawContext(ctx.id, {
|
|
35
|
+
onFeatures: applyFeatures,
|
|
36
|
+
onMode: applyMode
|
|
37
|
+
});
|
|
38
|
+
const draw = drawContext.draw;
|
|
39
|
+
provide(DrawKey, drawContext);
|
|
40
|
+
const addressable = getMapContext(ctx.id) === ctx;
|
|
41
|
+
if (addressable) registerDraw(drawContext);
|
|
42
|
+
let instance;
|
|
43
|
+
let boundMap;
|
|
44
|
+
let toolbar;
|
|
45
|
+
let selectedId;
|
|
46
|
+
function syncFeatures() {
|
|
47
|
+
if (instance && !applying) applyFeatures(committedFeatures(instance));
|
|
48
|
+
}
|
|
49
|
+
function setFeatures(list) {
|
|
50
|
+
if (!instance) return;
|
|
51
|
+
applying = true;
|
|
52
|
+
instance.clear();
|
|
53
|
+
addStoreFeatures(instance, toStoreFeatures(instance, { type: "FeatureCollection", features: list }));
|
|
54
|
+
applying = false;
|
|
55
|
+
syncFeatures();
|
|
56
|
+
}
|
|
57
|
+
function hasMode(name) {
|
|
58
|
+
return modeNames.includes(name);
|
|
59
|
+
}
|
|
60
|
+
function setMode(value) {
|
|
61
|
+
if (!instance || instance.getMode() === value) return;
|
|
62
|
+
instance.setMode(value);
|
|
63
|
+
applyMode(value);
|
|
64
|
+
}
|
|
65
|
+
const onChange = (ids, type) => {
|
|
66
|
+
if (type === "styling") return;
|
|
67
|
+
if (type === "delete" && !applying) emit("delete", ids);
|
|
68
|
+
syncFeatures();
|
|
69
|
+
};
|
|
70
|
+
const onFinish = (id, context) => {
|
|
71
|
+
emit("finish", id, context);
|
|
72
|
+
syncFeatures();
|
|
73
|
+
};
|
|
74
|
+
const onSelect = (id) => {
|
|
75
|
+
selectedId = id;
|
|
76
|
+
emit("select", id);
|
|
77
|
+
};
|
|
78
|
+
const onDeselect = (id) => {
|
|
79
|
+
if (selectedId === id) selectedId = void 0;
|
|
80
|
+
emit("deselect", id);
|
|
81
|
+
};
|
|
82
|
+
function onStyleLoad() {
|
|
83
|
+
if (!instance) return;
|
|
84
|
+
const snapshot = committedFeatures(instance);
|
|
85
|
+
const current = instance.getMode();
|
|
86
|
+
try {
|
|
87
|
+
instance.stop();
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
instance.start();
|
|
91
|
+
applying = true;
|
|
92
|
+
instance.clear();
|
|
93
|
+
addStoreFeatures(instance, snapshot);
|
|
94
|
+
applying = false;
|
|
95
|
+
instance.setMode(current);
|
|
96
|
+
}
|
|
97
|
+
const modes = props.modes ?? movkDrawModes({ theme: props.theme });
|
|
98
|
+
const modeNames = modes.map((m) => m.mode);
|
|
99
|
+
function toolbarModes() {
|
|
100
|
+
if (props.controls === false) return [];
|
|
101
|
+
return props.controls === true ? modeNames : props.controls.filter((name) => modeNames.includes(name));
|
|
102
|
+
}
|
|
103
|
+
onMounted(async () => {
|
|
104
|
+
const map = await ctx.whenLoaded();
|
|
105
|
+
boundMap = map;
|
|
106
|
+
instance = new TerraDraw({
|
|
107
|
+
adapter: new TerraDrawMapLibreGLAdapter({ map, renderBelowLayerId: props.renderBelowLayerId }),
|
|
108
|
+
modes
|
|
109
|
+
});
|
|
110
|
+
instance.start();
|
|
111
|
+
instance.on("change", onChange);
|
|
112
|
+
instance.on("finish", onFinish);
|
|
113
|
+
instance.on("select", onSelect);
|
|
114
|
+
instance.on("deselect", onDeselect);
|
|
115
|
+
map.on("style.load", onStyleLoad);
|
|
116
|
+
if (props.controls !== false) {
|
|
117
|
+
toolbar = createDrawToolbar({
|
|
118
|
+
modes: toolbarModes(),
|
|
119
|
+
// 再次点击当前绘制模式回到选择模式,与常见绘图工具一致
|
|
120
|
+
onMode: (name) => setMode(name === instance?.getMode() && hasMode("select") ? "select" : name),
|
|
121
|
+
onTrash: () => {
|
|
122
|
+
if (selectedId !== void 0 && instance?.hasFeature(selectedId)) instance.removeFeatures([selectedId]);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
map.addControl(toolbar, props.position);
|
|
126
|
+
}
|
|
127
|
+
attach(instance);
|
|
128
|
+
if (features.value?.length) setFeatures(features.value);
|
|
129
|
+
const initial = mode.value ?? (modeNames.includes("select") ? "select" : instance.getMode());
|
|
130
|
+
instance.setMode(initial);
|
|
131
|
+
applyMode(initial);
|
|
132
|
+
});
|
|
133
|
+
watch(features, (value) => {
|
|
134
|
+
if (!instance || !value) return;
|
|
135
|
+
if (JSON.stringify(value) === lastSyncedJson) return;
|
|
136
|
+
setFeatures(value);
|
|
137
|
+
}, { deep: true });
|
|
138
|
+
watch(mode, (value) => {
|
|
139
|
+
if (value) setMode(value);
|
|
140
|
+
});
|
|
141
|
+
onUnmounted(() => {
|
|
142
|
+
if (addressable) unregisterDraw(drawContext);
|
|
143
|
+
boundMap?.off("style.load", onStyleLoad);
|
|
144
|
+
if (toolbar) boundMap?.removeControl(toolbar);
|
|
145
|
+
if (!instance) return;
|
|
146
|
+
instance.off("change", onChange);
|
|
147
|
+
instance.off("finish", onFinish);
|
|
148
|
+
instance.off("select", onSelect);
|
|
149
|
+
instance.off("deselect", onDeselect);
|
|
150
|
+
instance.stop();
|
|
151
|
+
});
|
|
152
|
+
const { whenReady, getAll, getMode, add, deleteAll, changeMode, setFeatureProperty } = drawContext;
|
|
153
|
+
defineExpose({
|
|
154
|
+
/** terra-draw 实例引用;挂载前为 undefined */
|
|
155
|
+
draw,
|
|
156
|
+
whenReady,
|
|
157
|
+
getAll,
|
|
158
|
+
getMode,
|
|
159
|
+
add,
|
|
160
|
+
deleteAll,
|
|
161
|
+
changeMode,
|
|
162
|
+
setFeatureProperty
|
|
163
|
+
});
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<template>
|
|
167
|
+
<slot />
|
|
168
|
+
</template>
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TiandituLayerType } from '../../utils/tianditu';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 天地图图层类型(vec 矢量底图)
|
|
5
|
+
* @defaultValue 'vec'
|
|
6
|
+
*/
|
|
7
|
+
layer?: TiandituLayerType;
|
|
8
|
+
/** 天地图 token;缺省时回退运行时配置 */
|
|
9
|
+
tk?: string;
|
|
10
|
+
/** 叠加对应注记图层(vec→cva / img→cia / ter→cta) */
|
|
11
|
+
annotation?: boolean;
|
|
12
|
+
/** 插入到该图层之前 */
|
|
13
|
+
beforeId?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
layer: TiandituLayerType;
|
|
17
|
+
annotation: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { tiandituAnnotationFor, tiandituRasterSource } from "../../utils/tianditu";
|
|
4
|
+
import MaplibreSource from "../Source.vue";
|
|
5
|
+
import MaplibreLayer from "../Layer.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
layer: { type: String, required: false, default: "vec" },
|
|
8
|
+
tk: { type: String, required: false },
|
|
9
|
+
annotation: { type: Boolean, required: false, default: false },
|
|
10
|
+
beforeId: { type: String, required: false }
|
|
11
|
+
});
|
|
12
|
+
const BASE_ID = "tianditu-base";
|
|
13
|
+
const ANNOTATION_ID = "tianditu-annotation";
|
|
14
|
+
const source = computed(() => tiandituRasterSource(props.layer, { tk: props.tk }));
|
|
15
|
+
const annoType = computed(() => props.annotation ? tiandituAnnotationFor(props.layer) : void 0);
|
|
16
|
+
const annoSource = computed(() => annoType.value ? tiandituRasterSource(annoType.value, { tk: props.tk }) : void 0);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<MaplibreSource :source-id="BASE_ID" :source="source">
|
|
21
|
+
<MaplibreLayer :layer-id="BASE_ID" type="raster" :source="BASE_ID" :before-id="beforeId" />
|
|
22
|
+
</MaplibreSource>
|
|
23
|
+
<MaplibreSource v-if="annoSource" :source-id="ANNOTATION_ID" :source="annoSource">
|
|
24
|
+
<MaplibreLayer :layer-id="ANNOTATION_ID" type="raster" :source="ANNOTATION_ID" :before-id="beforeId" />
|
|
25
|
+
</MaplibreSource>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TiandituLayerType } from '../../utils/tianditu';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/**
|
|
4
|
+
* 天地图图层类型(vec 矢量底图)
|
|
5
|
+
* @defaultValue 'vec'
|
|
6
|
+
*/
|
|
7
|
+
layer?: TiandituLayerType;
|
|
8
|
+
/** 天地图 token;缺省时回退运行时配置 */
|
|
9
|
+
tk?: string;
|
|
10
|
+
/** 叠加对应注记图层(vec→cva / img→cia / ter→cta) */
|
|
11
|
+
annotation?: boolean;
|
|
12
|
+
/** 插入到该图层之前 */
|
|
13
|
+
beforeId?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
layer: TiandituLayerType;
|
|
17
|
+
annotation: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** WMS 服务基础地址 */
|
|
3
|
+
url: string;
|
|
4
|
+
/** 图层 LAYERS(逗号分隔多层) */
|
|
5
|
+
layers: string;
|
|
6
|
+
/**
|
|
7
|
+
* source/layer id
|
|
8
|
+
* @defaultValue `wms-${layers}`
|
|
9
|
+
*/
|
|
10
|
+
layerId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* WMS 版本
|
|
13
|
+
* @defaultValue '1.1.1'
|
|
14
|
+
*/
|
|
15
|
+
version?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 图片格式
|
|
18
|
+
* @defaultValue 'image/png'
|
|
19
|
+
*/
|
|
20
|
+
format?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 是否透明
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
transparent?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 样式
|
|
28
|
+
* @defaultValue ''
|
|
29
|
+
*/
|
|
30
|
+
styles?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 坐标参考系
|
|
33
|
+
* @defaultValue 'EPSG:3857'
|
|
34
|
+
*/
|
|
35
|
+
crs?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 瓦片尺寸
|
|
38
|
+
* @defaultValue 256
|
|
39
|
+
*/
|
|
40
|
+
tileSize?: number;
|
|
41
|
+
/** 版权信息 */
|
|
42
|
+
attribution?: string;
|
|
43
|
+
/** 透传查询参数 */
|
|
44
|
+
params?: Record<string, string | undefined>;
|
|
45
|
+
/** 插入到该图层之前 */
|
|
46
|
+
beforeId?: string;
|
|
47
|
+
};
|
|
48
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|