@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,75 @@
|
|
|
1
|
+
import type { FilterSpecification, LayerSpecification, SourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type PropBag = Record<string, unknown>;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 图层 id,全局唯一 */
|
|
5
|
+
layerId: string;
|
|
6
|
+
/**
|
|
7
|
+
* 图层类型,决定渲染方式与可用的 paint / layout 属性
|
|
8
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
9
|
+
*/
|
|
10
|
+
type: LayerSpecification['type'];
|
|
11
|
+
/** source id 字符串引用,或内联 source 对象(自动创建匿名源并随图层卸载) */
|
|
12
|
+
source?: string | SourceSpecification;
|
|
13
|
+
/** 矢量瓦片源内的子图层名(source-layer),消费矢量源时必填 */
|
|
14
|
+
sourceLayer?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 绘制样式属性,响应式变更经 setPaintProperty 增量下发
|
|
17
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
18
|
+
*/
|
|
19
|
+
paint?: PropBag;
|
|
20
|
+
/**
|
|
21
|
+
* 布局属性,响应式变更经 setLayoutProperty 增量下发
|
|
22
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
23
|
+
*/
|
|
24
|
+
layout?: PropBag;
|
|
25
|
+
/**
|
|
26
|
+
* 过滤表达式,仅渲染匹配的要素
|
|
27
|
+
* @see https://maplibre.org/maplibre-style-spec/expressions/
|
|
28
|
+
*/
|
|
29
|
+
filter?: FilterSpecification;
|
|
30
|
+
/**
|
|
31
|
+
* 最小缩放级别,低于此级别不渲染
|
|
32
|
+
* @defaultValue 0
|
|
33
|
+
*/
|
|
34
|
+
minzoom?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 最大缩放级别,高于此级别不渲染
|
|
37
|
+
* @defaultValue 24
|
|
38
|
+
*/
|
|
39
|
+
maxzoom?: number;
|
|
40
|
+
/** 插入到该 id 图层之前;省略则追加到图层栈顶部 */
|
|
41
|
+
beforeId?: string;
|
|
42
|
+
};
|
|
43
|
+
declare var __VLS_1: {};
|
|
44
|
+
type __VLS_Slots = {} & {
|
|
45
|
+
default?: (props: typeof __VLS_1) => any;
|
|
46
|
+
};
|
|
47
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
|
+
click: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
49
|
+
contextmenu: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
50
|
+
dblclick: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
51
|
+
mousemove: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
52
|
+
mouseup: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
53
|
+
mousedown: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
54
|
+
mouseenter: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
55
|
+
mouseleave: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
57
|
+
onClick?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
58
|
+
onContextmenu?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
59
|
+
onDblclick?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
60
|
+
onMousemove?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
61
|
+
onMouseup?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
62
|
+
onMousedown?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
63
|
+
onMouseenter?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
64
|
+
onMouseleave?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
filter: FilterSpecification;
|
|
67
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
69
|
+
declare const _default: typeof __VLS_export;
|
|
70
|
+
export default _default;
|
|
71
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject, onUnmounted, watch } from "vue";
|
|
3
|
+
import { omitUndefined } from "@movk/core";
|
|
4
|
+
import { useMap } from "../composables/useMap";
|
|
5
|
+
import { LayerGroupKey } from "../domains/map/layer-group";
|
|
6
|
+
import { applyLayerProps } from "../utils/layer";
|
|
7
|
+
import { bindMapEvents } from "../utils/events";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
layerId: { type: String, required: true },
|
|
10
|
+
type: { type: String, required: true },
|
|
11
|
+
source: { type: [String, Object], required: false },
|
|
12
|
+
sourceLayer: { type: String, required: false },
|
|
13
|
+
paint: { type: Object, required: false },
|
|
14
|
+
layout: { type: Object, required: false },
|
|
15
|
+
filter: { type: [Boolean, Array], required: false, default: void 0 },
|
|
16
|
+
minzoom: { type: Number, required: false },
|
|
17
|
+
maxzoom: { type: Number, required: false },
|
|
18
|
+
beforeId: { type: String, required: false }
|
|
19
|
+
});
|
|
20
|
+
const emit = defineEmits(["click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseenter", "mouseleave", "contextmenu"]);
|
|
21
|
+
const LAYER_EVENTS = ["click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseenter", "mouseleave", "contextmenu"];
|
|
22
|
+
const ctx = useMap();
|
|
23
|
+
const group = inject(LayerGroupKey, null);
|
|
24
|
+
const inlineSourceId = `${props.layerId}__source`;
|
|
25
|
+
const hasInlineSource = typeof props.source === "object";
|
|
26
|
+
function resolveSourceId() {
|
|
27
|
+
if (props.source === void 0) return void 0;
|
|
28
|
+
return hasInlineSource ? inlineSourceId : props.source;
|
|
29
|
+
}
|
|
30
|
+
function buildSpec() {
|
|
31
|
+
const spec = omitUndefined({
|
|
32
|
+
id: props.layerId,
|
|
33
|
+
type: props.type,
|
|
34
|
+
source: resolveSourceId(),
|
|
35
|
+
paint: props.paint,
|
|
36
|
+
layout: props.layout,
|
|
37
|
+
filter: props.filter,
|
|
38
|
+
minzoom: props.minzoom,
|
|
39
|
+
maxzoom: props.maxzoom
|
|
40
|
+
});
|
|
41
|
+
if (props.sourceLayer) spec["source-layer"] = props.sourceLayer;
|
|
42
|
+
return spec;
|
|
43
|
+
}
|
|
44
|
+
function addLayer(map) {
|
|
45
|
+
if (map.getLayer(props.layerId)) return;
|
|
46
|
+
if (hasInlineSource && !map.getSource(inlineSourceId)) {
|
|
47
|
+
map.addSource(inlineSourceId, props.source);
|
|
48
|
+
}
|
|
49
|
+
const anchor = props.beforeId ?? group?.beforeId.value;
|
|
50
|
+
const before = anchor && map.getLayer(anchor) ? anchor : void 0;
|
|
51
|
+
map.addLayer(buildSpec(), before);
|
|
52
|
+
if (group && !group.visible.value) {
|
|
53
|
+
map.setLayoutProperty(props.layerId, "visibility", "none");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let stopEvents;
|
|
57
|
+
let onSourceData;
|
|
58
|
+
const stopReady = ctx.onReady((map) => {
|
|
59
|
+
const sourceId = resolveSourceId();
|
|
60
|
+
if (sourceId && !hasInlineSource && !map.getSource(sourceId)) {
|
|
61
|
+
if (onSourceData) map.off("sourcedata", onSourceData);
|
|
62
|
+
onSourceData = (event) => {
|
|
63
|
+
if (event.sourceId === sourceId && map.getSource(sourceId)) {
|
|
64
|
+
map.off("sourcedata", onSourceData);
|
|
65
|
+
onSourceData = void 0;
|
|
66
|
+
addLayer(map);
|
|
67
|
+
bindLayerEvents(map);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
map.on("sourcedata", onSourceData);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
addLayer(map);
|
|
74
|
+
bindLayerEvents(map);
|
|
75
|
+
});
|
|
76
|
+
function bindLayerEvents(map) {
|
|
77
|
+
stopEvents?.();
|
|
78
|
+
stopEvents = bindMapEvents(map, LAYER_EVENTS, (type, event) => emit(type, event), props.layerId);
|
|
79
|
+
}
|
|
80
|
+
let prev = { id: props.layerId, paint: props.paint, layout: props.layout, filter: props.filter, minzoom: props.minzoom, maxzoom: props.maxzoom };
|
|
81
|
+
watch(
|
|
82
|
+
() => [props.paint, props.layout, props.filter, props.minzoom, props.maxzoom],
|
|
83
|
+
() => {
|
|
84
|
+
const map = ctx.map.value;
|
|
85
|
+
if (!map?.getLayer(props.layerId)) return;
|
|
86
|
+
const next = { id: props.layerId, paint: props.paint, layout: props.layout, filter: props.filter, minzoom: props.minzoom, maxzoom: props.maxzoom };
|
|
87
|
+
applyLayerProps(map, next, prev);
|
|
88
|
+
prev = next;
|
|
89
|
+
},
|
|
90
|
+
{ deep: true }
|
|
91
|
+
);
|
|
92
|
+
if (group) {
|
|
93
|
+
watch(group.visible, (visible) => {
|
|
94
|
+
const map = ctx.map.value;
|
|
95
|
+
if (!map?.getLayer(props.layerId)) return;
|
|
96
|
+
map.setLayoutProperty(props.layerId, "visibility", visible ? "visible" : "none");
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
onUnmounted(() => {
|
|
100
|
+
stopReady();
|
|
101
|
+
stopEvents?.();
|
|
102
|
+
const map = ctx.map.value;
|
|
103
|
+
if (!map) return;
|
|
104
|
+
if (onSourceData) map.off("sourcedata", onSourceData);
|
|
105
|
+
if (map.getLayer(props.layerId)) map.removeLayer(props.layerId);
|
|
106
|
+
if (hasInlineSource && map.getSource(inlineSourceId)) map.removeSource(inlineSourceId);
|
|
107
|
+
});
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<template>
|
|
111
|
+
<slot />
|
|
112
|
+
</template>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FilterSpecification, LayerSpecification, SourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type PropBag = Record<string, unknown>;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 图层 id,全局唯一 */
|
|
5
|
+
layerId: string;
|
|
6
|
+
/**
|
|
7
|
+
* 图层类型,决定渲染方式与可用的 paint / layout 属性
|
|
8
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
9
|
+
*/
|
|
10
|
+
type: LayerSpecification['type'];
|
|
11
|
+
/** source id 字符串引用,或内联 source 对象(自动创建匿名源并随图层卸载) */
|
|
12
|
+
source?: string | SourceSpecification;
|
|
13
|
+
/** 矢量瓦片源内的子图层名(source-layer),消费矢量源时必填 */
|
|
14
|
+
sourceLayer?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 绘制样式属性,响应式变更经 setPaintProperty 增量下发
|
|
17
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
18
|
+
*/
|
|
19
|
+
paint?: PropBag;
|
|
20
|
+
/**
|
|
21
|
+
* 布局属性,响应式变更经 setLayoutProperty 增量下发
|
|
22
|
+
* @see https://maplibre.org/maplibre-style-spec/layers/
|
|
23
|
+
*/
|
|
24
|
+
layout?: PropBag;
|
|
25
|
+
/**
|
|
26
|
+
* 过滤表达式,仅渲染匹配的要素
|
|
27
|
+
* @see https://maplibre.org/maplibre-style-spec/expressions/
|
|
28
|
+
*/
|
|
29
|
+
filter?: FilterSpecification;
|
|
30
|
+
/**
|
|
31
|
+
* 最小缩放级别,低于此级别不渲染
|
|
32
|
+
* @defaultValue 0
|
|
33
|
+
*/
|
|
34
|
+
minzoom?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 最大缩放级别,高于此级别不渲染
|
|
37
|
+
* @defaultValue 24
|
|
38
|
+
*/
|
|
39
|
+
maxzoom?: number;
|
|
40
|
+
/** 插入到该 id 图层之前;省略则追加到图层栈顶部 */
|
|
41
|
+
beforeId?: string;
|
|
42
|
+
};
|
|
43
|
+
declare var __VLS_1: {};
|
|
44
|
+
type __VLS_Slots = {} & {
|
|
45
|
+
default?: (props: typeof __VLS_1) => any;
|
|
46
|
+
};
|
|
47
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
|
+
click: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
49
|
+
contextmenu: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
50
|
+
dblclick: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
51
|
+
mousemove: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
52
|
+
mouseup: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
53
|
+
mousedown: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
54
|
+
mouseenter: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
55
|
+
mouseleave: (event: import("maplibre-gl").MapLayerMouseEvent) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
57
|
+
onClick?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
58
|
+
onContextmenu?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
59
|
+
onDblclick?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
60
|
+
onMousemove?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
61
|
+
onMouseup?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
62
|
+
onMousedown?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
63
|
+
onMouseenter?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
64
|
+
onMouseleave?: ((event: import("maplibre-gl").MapLayerMouseEvent) => any) | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
filter: FilterSpecification;
|
|
67
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
68
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
69
|
+
declare const _default: typeof __VLS_export;
|
|
70
|
+
export default _default;
|
|
71
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 图层组:统一子图层的插入锚点与显隐(组开关优先于子图层自身 layout.visibility)。 */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 组内图层缺省插入到该图层之前 */
|
|
4
|
+
beforeId?: string;
|
|
5
|
+
/**
|
|
6
|
+
* 组级显隐
|
|
7
|
+
* @defaultValue true
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { provide, toRef } from "vue";
|
|
3
|
+
import { LayerGroupKey } from "../domains/map/layer-group";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
beforeId: { type: String, required: false },
|
|
6
|
+
visible: { type: Boolean, required: false, default: true }
|
|
7
|
+
});
|
|
8
|
+
provide(LayerGroupKey, {
|
|
9
|
+
beforeId: toRef(props, "beforeId"),
|
|
10
|
+
visible: toRef(props, "visible")
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<slot />
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 图层组:统一子图层的插入锚点与显隐(组开关优先于子图层自身 layout.visibility)。 */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 组内图层缺省插入到该图层之前 */
|
|
4
|
+
beforeId?: string;
|
|
5
|
+
/**
|
|
6
|
+
* 组级显隐
|
|
7
|
+
* @defaultValue true
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { LngLatLike } from 'maplibre-gl';
|
|
2
|
+
/** Lottie 标记:在地图标记位用 lottie-web 渲染矢量动画(走 Marker DOM,非 icon 帧驱动)。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** lottie 动画数据(JSON 对象);与 path 二选一 */
|
|
5
|
+
animationData?: object;
|
|
6
|
+
/** lottie 动画 URL;与 animationData 二选一 */
|
|
7
|
+
path?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 是否循环
|
|
10
|
+
* @defaultValue true
|
|
11
|
+
*/
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否自动播放
|
|
15
|
+
* @defaultValue true
|
|
16
|
+
*/
|
|
17
|
+
autoplay?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 播放速度倍率
|
|
20
|
+
* @defaultValue 1
|
|
21
|
+
*/
|
|
22
|
+
speed?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 容器宽(像素)
|
|
25
|
+
* @defaultValue 64
|
|
26
|
+
*/
|
|
27
|
+
width?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 容器高(像素)
|
|
30
|
+
* @defaultValue 64
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_ModelProps = {
|
|
35
|
+
'lnglat': LngLatLike;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:lnglat": (value: LngLatLike) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
41
|
+
"onUpdate:lnglat"?: ((value: LngLatLike) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
loop: boolean;
|
|
46
|
+
autoplay: boolean;
|
|
47
|
+
speed: number;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, onUnmounted, useTemplateRef, watch } from "vue";
|
|
3
|
+
import lottie from "lottie-web";
|
|
4
|
+
import MaplibreMarker from "./Marker.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
animationData: { type: Object, required: false },
|
|
7
|
+
path: { type: String, required: false },
|
|
8
|
+
loop: { type: Boolean, required: false, default: true },
|
|
9
|
+
autoplay: { type: Boolean, required: false, default: true },
|
|
10
|
+
speed: { type: Number, required: false, default: 1 },
|
|
11
|
+
width: { type: Number, required: false, default: 64 },
|
|
12
|
+
height: { type: Number, required: false, default: 64 }
|
|
13
|
+
});
|
|
14
|
+
const lnglat = defineModel("lnglat", { type: [Object, Array], ...{ required: true } });
|
|
15
|
+
const container = useTemplateRef("container");
|
|
16
|
+
let anim;
|
|
17
|
+
onMounted(() => {
|
|
18
|
+
if (!container.value) return;
|
|
19
|
+
const base = { container: container.value, renderer: "svg", loop: props.loop, autoplay: props.autoplay };
|
|
20
|
+
anim = props.path ? lottie.loadAnimation({ ...base, path: props.path }) : lottie.loadAnimation({ ...base, animationData: props.animationData });
|
|
21
|
+
anim.setSpeed(props.speed);
|
|
22
|
+
});
|
|
23
|
+
watch(() => props.speed, (speed) => anim?.setSpeed(speed));
|
|
24
|
+
onUnmounted(() => anim?.destroy());
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<MaplibreMarker v-model:lnglat="lnglat">
|
|
29
|
+
<div ref="container" :style="{ width: `${width}px`, height: `${height}px` }" />
|
|
30
|
+
</MaplibreMarker>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { LngLatLike } from 'maplibre-gl';
|
|
2
|
+
/** Lottie 标记:在地图标记位用 lottie-web 渲染矢量动画(走 Marker DOM,非 icon 帧驱动)。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** lottie 动画数据(JSON 对象);与 path 二选一 */
|
|
5
|
+
animationData?: object;
|
|
6
|
+
/** lottie 动画 URL;与 animationData 二选一 */
|
|
7
|
+
path?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 是否循环
|
|
10
|
+
* @defaultValue true
|
|
11
|
+
*/
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否自动播放
|
|
15
|
+
* @defaultValue true
|
|
16
|
+
*/
|
|
17
|
+
autoplay?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 播放速度倍率
|
|
20
|
+
* @defaultValue 1
|
|
21
|
+
*/
|
|
22
|
+
speed?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 容器宽(像素)
|
|
25
|
+
* @defaultValue 64
|
|
26
|
+
*/
|
|
27
|
+
width?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 容器高(像素)
|
|
30
|
+
* @defaultValue 64
|
|
31
|
+
*/
|
|
32
|
+
height?: number;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_ModelProps = {
|
|
35
|
+
'lnglat': LngLatLike;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:lnglat": (value: LngLatLike) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
41
|
+
"onUpdate:lnglat"?: ((value: LngLatLike) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
loop: boolean;
|
|
46
|
+
autoplay: boolean;
|
|
47
|
+
speed: number;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LngLatLike, Map as MaplibreMap } from 'maplibre-gl';
|
|
2
|
+
import type { MaplibreMapOptions } from '../types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 地图 id;省略时自动生成。提供后可经 useMaplibre(id) 外部访问 */
|
|
5
|
+
mapId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* maplibre-gl Map 初始化选项(container 由组件接管);缺省 style 时使用空白样式
|
|
8
|
+
* @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/
|
|
9
|
+
*/
|
|
10
|
+
options?: MaplibreMapOptions;
|
|
11
|
+
/** 卸载时不销毁实例,配合 keepalive / `<keep-alive>` 跨路由复用 */
|
|
12
|
+
persistent?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_ModelProps = {
|
|
15
|
+
'center'?: LngLatLike;
|
|
16
|
+
'zoom'?: number;
|
|
17
|
+
'bearing'?: number;
|
|
18
|
+
'pitch'?: number;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare var __VLS_1: {};
|
|
22
|
+
type __VLS_Slots = {} & {
|
|
23
|
+
default?: (props: typeof __VLS_1) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
26
|
+
/** 当前地图上下文 */
|
|
27
|
+
context: () => import("../types").MaplibreContext;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
click: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
30
|
+
load: (map: MaplibreMap) => any;
|
|
31
|
+
error: (event: import("maplibre-gl").ErrorEvent) => any;
|
|
32
|
+
idle: (map: MaplibreMap) => any;
|
|
33
|
+
sourcedata: (event: import("maplibre-gl").MapSourceDataEvent) => any;
|
|
34
|
+
styledata: (event: import("maplibre-gl").MapStyleDataEvent) => any;
|
|
35
|
+
contextmenu: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
36
|
+
dblclick: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
37
|
+
mousemove: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
38
|
+
mouseup: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
39
|
+
mousedown: (event: import("maplibre-gl").MapMouseEvent) => any;
|
|
40
|
+
movestart: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
41
|
+
moveend: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
42
|
+
zoomstart: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
43
|
+
zoomend: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
44
|
+
rotateend: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
45
|
+
dragend: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
46
|
+
pitchend: (event: import("maplibre-gl").MapMovementEvent) => any;
|
|
47
|
+
"update:center": (value: LngLatLike | undefined) => any;
|
|
48
|
+
"update:zoom": (value: number | undefined) => any;
|
|
49
|
+
"update:bearing": (value: number | undefined) => any;
|
|
50
|
+
"update:pitch": (value: number | undefined) => any;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
52
|
+
onClick?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
53
|
+
onLoad?: ((map: MaplibreMap) => any) | undefined;
|
|
54
|
+
onError?: ((event: import("maplibre-gl").ErrorEvent) => any) | undefined;
|
|
55
|
+
onIdle?: ((map: MaplibreMap) => any) | undefined;
|
|
56
|
+
onSourcedata?: ((event: import("maplibre-gl").MapSourceDataEvent) => any) | undefined;
|
|
57
|
+
onStyledata?: ((event: import("maplibre-gl").MapStyleDataEvent) => any) | undefined;
|
|
58
|
+
onContextmenu?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
59
|
+
onDblclick?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
60
|
+
onMousemove?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
61
|
+
onMouseup?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
62
|
+
onMousedown?: ((event: import("maplibre-gl").MapMouseEvent) => any) | undefined;
|
|
63
|
+
onMovestart?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
64
|
+
onMoveend?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
65
|
+
onZoomstart?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
66
|
+
onZoomend?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
67
|
+
onRotateend?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
68
|
+
onDragend?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
69
|
+
onPitchend?: ((event: import("maplibre-gl").MapMovementEvent) => any) | undefined;
|
|
70
|
+
"onUpdate:center"?: ((value: LngLatLike | undefined) => any) | undefined;
|
|
71
|
+
"onUpdate:zoom"?: ((value: number | undefined) => any) | undefined;
|
|
72
|
+
"onUpdate:bearing"?: ((value: number | undefined) => any) | undefined;
|
|
73
|
+
"onUpdate:pitch"?: ((value: number | undefined) => any) | undefined;
|
|
74
|
+
}>, {
|
|
75
|
+
persistent: boolean;
|
|
76
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
77
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
78
|
+
declare const _default: typeof __VLS_export;
|
|
79
|
+
export default _default;
|
|
80
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
81
|
+
new (): {
|
|
82
|
+
$slots: S;
|
|
83
|
+
};
|
|
84
|
+
};
|