@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,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { wmsRasterSource } from "../../utils/wms";
|
|
4
|
+
import MaplibreSource from "../Source.vue";
|
|
5
|
+
import MaplibreLayer from "../Layer.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
url: { type: String, required: true },
|
|
8
|
+
layers: { type: String, required: true },
|
|
9
|
+
layerId: { type: String, required: false },
|
|
10
|
+
version: { type: String, required: false },
|
|
11
|
+
format: { type: String, required: false },
|
|
12
|
+
transparent: { type: Boolean, required: false },
|
|
13
|
+
styles: { type: String, required: false },
|
|
14
|
+
crs: { type: String, required: false },
|
|
15
|
+
tileSize: { type: Number, required: false },
|
|
16
|
+
attribution: { type: String, required: false },
|
|
17
|
+
params: { type: Object, required: false },
|
|
18
|
+
beforeId: { type: String, required: false }
|
|
19
|
+
});
|
|
20
|
+
const id = computed(() => props.layerId ?? `wms-${props.layers}`);
|
|
21
|
+
const source = computed(() => wmsRasterSource({
|
|
22
|
+
url: props.url,
|
|
23
|
+
layers: props.layers,
|
|
24
|
+
version: props.version,
|
|
25
|
+
format: props.format,
|
|
26
|
+
transparent: props.transparent,
|
|
27
|
+
styles: props.styles,
|
|
28
|
+
crs: props.crs,
|
|
29
|
+
tileSize: props.tileSize,
|
|
30
|
+
attribution: props.attribution,
|
|
31
|
+
params: props.params
|
|
32
|
+
}));
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<MaplibreSource :key="id" :source-id="id" :source="source">
|
|
37
|
+
<MaplibreLayer :layer-id="id" type="raster" :source="id" :before-id="beforeId" />
|
|
38
|
+
</MaplibreSource>
|
|
39
|
+
</template>
|
|
@@ -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;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** WMTS 服务基础地址;含 {s} 时配合 subdomains 展开 */
|
|
3
|
+
url: string;
|
|
4
|
+
/** 图层标识 LAYER */
|
|
5
|
+
layer: string;
|
|
6
|
+
/**
|
|
7
|
+
* source/layer id
|
|
8
|
+
* @defaultValue `wmts-${layer}`
|
|
9
|
+
*/
|
|
10
|
+
layerId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 瓦片矩阵集
|
|
13
|
+
* @defaultValue 'w'
|
|
14
|
+
*/
|
|
15
|
+
tileMatrixSet?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 样式
|
|
18
|
+
* @defaultValue 'default'
|
|
19
|
+
*/
|
|
20
|
+
style?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 瓦片格式
|
|
23
|
+
* @defaultValue 'tiles'
|
|
24
|
+
*/
|
|
25
|
+
format?: string;
|
|
26
|
+
/** 子域名列表,替换 url 中的 {s} */
|
|
27
|
+
subdomains?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* 瓦片尺寸
|
|
30
|
+
* @defaultValue 256
|
|
31
|
+
*/
|
|
32
|
+
tileSize?: number;
|
|
33
|
+
/** 版权信息 */
|
|
34
|
+
attribution?: string;
|
|
35
|
+
/** 透传查询参数(如 { tk }) */
|
|
36
|
+
params?: Record<string, string | undefined>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { wmtsRasterSource } from "../../utils/wmts";
|
|
4
|
+
import MaplibreSource from "../Source.vue";
|
|
5
|
+
import MaplibreLayer from "../Layer.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
url: { type: String, required: true },
|
|
8
|
+
layer: { type: String, required: true },
|
|
9
|
+
layerId: { type: String, required: false },
|
|
10
|
+
tileMatrixSet: { type: String, required: false },
|
|
11
|
+
style: { type: String, required: false },
|
|
12
|
+
format: { type: String, required: false },
|
|
13
|
+
subdomains: { type: Array, required: false },
|
|
14
|
+
tileSize: { type: Number, required: false },
|
|
15
|
+
attribution: { type: String, required: false },
|
|
16
|
+
params: { type: Object, required: false },
|
|
17
|
+
beforeId: { type: String, required: false }
|
|
18
|
+
});
|
|
19
|
+
const id = computed(() => props.layerId ?? `wmts-${props.layer}`);
|
|
20
|
+
const source = computed(() => wmtsRasterSource({
|
|
21
|
+
url: props.url,
|
|
22
|
+
layer: props.layer,
|
|
23
|
+
tileMatrixSet: props.tileMatrixSet,
|
|
24
|
+
style: props.style,
|
|
25
|
+
format: props.format,
|
|
26
|
+
subdomains: props.subdomains,
|
|
27
|
+
tileSize: props.tileSize,
|
|
28
|
+
attribution: props.attribution,
|
|
29
|
+
params: props.params
|
|
30
|
+
}));
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<MaplibreSource :key="id" :source-id="id" :source="source">
|
|
35
|
+
<MaplibreLayer :layer-id="id" type="raster" :source="id" :before-id="beforeId" />
|
|
36
|
+
</MaplibreSource>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** WMTS 服务基础地址;含 {s} 时配合 subdomains 展开 */
|
|
3
|
+
url: string;
|
|
4
|
+
/** 图层标识 LAYER */
|
|
5
|
+
layer: string;
|
|
6
|
+
/**
|
|
7
|
+
* source/layer id
|
|
8
|
+
* @defaultValue `wmts-${layer}`
|
|
9
|
+
*/
|
|
10
|
+
layerId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 瓦片矩阵集
|
|
13
|
+
* @defaultValue 'w'
|
|
14
|
+
*/
|
|
15
|
+
tileMatrixSet?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 样式
|
|
18
|
+
* @defaultValue 'default'
|
|
19
|
+
*/
|
|
20
|
+
style?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 瓦片格式
|
|
23
|
+
* @defaultValue 'tiles'
|
|
24
|
+
*/
|
|
25
|
+
format?: string;
|
|
26
|
+
/** 子域名列表,替换 url 中的 {s} */
|
|
27
|
+
subdomains?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* 瓦片尺寸
|
|
30
|
+
* @defaultValue 256
|
|
31
|
+
*/
|
|
32
|
+
tileSize?: number;
|
|
33
|
+
/** 版权信息 */
|
|
34
|
+
attribution?: string;
|
|
35
|
+
/** 透传查询参数(如 { tk }) */
|
|
36
|
+
params?: Record<string, string | undefined>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BuildingSourceOptions } from '../../utils/building';
|
|
2
|
+
/** 3D 建筑:按要素高度属性拉伸的 fill-extrusion 图层。 */
|
|
3
|
+
type __VLS_Props = BuildingSourceOptions & {
|
|
4
|
+
/** 图层 id;省略时自动生成 */
|
|
5
|
+
layerId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 建筑颜色
|
|
8
|
+
* @defaultValue '#aaa'
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 整体透明度
|
|
13
|
+
* @defaultValue 0.8
|
|
14
|
+
*/
|
|
15
|
+
opacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 显示建筑的最小缩放级别
|
|
18
|
+
* @defaultValue 15
|
|
19
|
+
*/
|
|
20
|
+
minzoom?: number;
|
|
21
|
+
/** 整体覆盖 paint(提供时忽略 color/opacity 预设) */
|
|
22
|
+
paint?: Record<string, unknown>;
|
|
23
|
+
/** 插入到该图层之前 */
|
|
24
|
+
beforeId?: string;
|
|
25
|
+
};
|
|
26
|
+
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>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useId } from "vue";
|
|
3
|
+
import { buildingLayerSpec } from "../../utils/building";
|
|
4
|
+
import MaplibreLayer from "../Layer.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
source: { type: String, required: true },
|
|
7
|
+
sourceLayer: { type: String, required: false },
|
|
8
|
+
heightProperty: { type: String, required: false },
|
|
9
|
+
baseProperty: { type: String, required: false },
|
|
10
|
+
layerId: { type: String, required: false },
|
|
11
|
+
color: { type: String, required: false },
|
|
12
|
+
opacity: { type: Number, required: false },
|
|
13
|
+
minzoom: { type: Number, required: false },
|
|
14
|
+
paint: { type: Object, required: false },
|
|
15
|
+
beforeId: { type: String, required: false }
|
|
16
|
+
});
|
|
17
|
+
const id = props.layerId ?? `movk-building-${useId()}`;
|
|
18
|
+
const spec = computed(() => buildingLayerSpec({
|
|
19
|
+
id,
|
|
20
|
+
source: props.source,
|
|
21
|
+
sourceLayer: props.sourceLayer,
|
|
22
|
+
heightProperty: props.heightProperty,
|
|
23
|
+
baseProperty: props.baseProperty,
|
|
24
|
+
color: props.color,
|
|
25
|
+
opacity: props.opacity,
|
|
26
|
+
minzoom: props.minzoom,
|
|
27
|
+
paint: props.paint
|
|
28
|
+
}));
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<MaplibreLayer
|
|
33
|
+
:layer-id="id"
|
|
34
|
+
type="fill-extrusion"
|
|
35
|
+
:source="spec.source"
|
|
36
|
+
:source-layer="spec['source-layer']"
|
|
37
|
+
:minzoom="spec.minzoom"
|
|
38
|
+
:paint="spec.paint"
|
|
39
|
+
:before-id="beforeId"
|
|
40
|
+
/>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BuildingSourceOptions } from '../../utils/building';
|
|
2
|
+
/** 3D 建筑:按要素高度属性拉伸的 fill-extrusion 图层。 */
|
|
3
|
+
type __VLS_Props = BuildingSourceOptions & {
|
|
4
|
+
/** 图层 id;省略时自动生成 */
|
|
5
|
+
layerId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* 建筑颜色
|
|
8
|
+
* @defaultValue '#aaa'
|
|
9
|
+
*/
|
|
10
|
+
color?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 整体透明度
|
|
13
|
+
* @defaultValue 0.8
|
|
14
|
+
*/
|
|
15
|
+
opacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 显示建筑的最小缩放级别
|
|
18
|
+
* @defaultValue 15
|
|
19
|
+
*/
|
|
20
|
+
minzoom?: number;
|
|
21
|
+
/** 整体覆盖 paint(提供时忽略 color/opacity 预设) */
|
|
22
|
+
paint?: Record<string, unknown>;
|
|
23
|
+
/** 插入到该图层之前 */
|
|
24
|
+
beforeId?: string;
|
|
25
|
+
};
|
|
26
|
+
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>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { MapGeoJSONFeature } from 'maplibre-gl';
|
|
2
|
+
import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
3
|
+
type PropBag = Record<string, unknown>;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** 点要素数据(GeoJSON 或其 URL) */
|
|
6
|
+
data: GeoJSONSourceSpecification['data'];
|
|
7
|
+
/** source 与图层 id 前缀;省略时自动生成 */
|
|
8
|
+
sourceId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 聚合半径(像素)
|
|
11
|
+
* @defaultValue 50
|
|
12
|
+
*/
|
|
13
|
+
clusterRadius?: number;
|
|
14
|
+
/**
|
|
15
|
+
* 超过该缩放级别不再聚合
|
|
16
|
+
* @defaultValue 14
|
|
17
|
+
*/
|
|
18
|
+
clusterMaxZoom?: number;
|
|
19
|
+
/** 覆盖聚合圆 paint */
|
|
20
|
+
clusterPaint?: PropBag;
|
|
21
|
+
/** 覆盖计数文字 layout */
|
|
22
|
+
countLayout?: PropBag;
|
|
23
|
+
/** 覆盖计数文字 paint */
|
|
24
|
+
countPaint?: PropBag;
|
|
25
|
+
/** 覆盖散点 paint */
|
|
26
|
+
pointPaint?: PropBag;
|
|
27
|
+
/**
|
|
28
|
+
* 点击聚合圆自动放大到展开级别
|
|
29
|
+
* @defaultValue true
|
|
30
|
+
*/
|
|
31
|
+
autoExpand?: boolean;
|
|
32
|
+
/** 插入到该图层之前 */
|
|
33
|
+
beforeId?: string;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
clusterClick: (payload: {
|
|
37
|
+
clusterId: number;
|
|
38
|
+
coordinates: [number, number];
|
|
39
|
+
expansionZoom: number;
|
|
40
|
+
}) => any;
|
|
41
|
+
pointClick: (feature: MapGeoJSONFeature) => any;
|
|
42
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
43
|
+
onClusterClick?: ((payload: {
|
|
44
|
+
clusterId: number;
|
|
45
|
+
coordinates: [number, number];
|
|
46
|
+
expansionZoom: number;
|
|
47
|
+
}) => any) | undefined;
|
|
48
|
+
onPointClick?: ((feature: MapGeoJSONFeature) => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
clusterRadius: number;
|
|
51
|
+
clusterMaxZoom: number;
|
|
52
|
+
autoExpand: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const _default: typeof __VLS_export;
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useId } from "vue";
|
|
3
|
+
import { clusterLayerSpecs } from "../../utils/cluster";
|
|
4
|
+
import { useMap } from "../../composables/useMap";
|
|
5
|
+
import { logger } from "../../utils/logger";
|
|
6
|
+
import MaplibreSource from "../Source.vue";
|
|
7
|
+
import MaplibreLayer from "../Layer.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
data: { type: null, required: true },
|
|
10
|
+
sourceId: { type: String, required: false },
|
|
11
|
+
clusterRadius: { type: Number, required: false, default: 50 },
|
|
12
|
+
clusterMaxZoom: { type: Number, required: false, default: 14 },
|
|
13
|
+
clusterPaint: { type: Object, required: false },
|
|
14
|
+
countLayout: { type: Object, required: false },
|
|
15
|
+
countPaint: { type: Object, required: false },
|
|
16
|
+
pointPaint: { type: Object, required: false },
|
|
17
|
+
autoExpand: { type: Boolean, required: false, default: true },
|
|
18
|
+
beforeId: { type: String, required: false }
|
|
19
|
+
});
|
|
20
|
+
const emit = defineEmits(["clusterClick", "pointClick"]);
|
|
21
|
+
const ctx = useMap();
|
|
22
|
+
const id = props.sourceId ?? `movk-cluster-${useId()}`;
|
|
23
|
+
const source = computed(() => ({
|
|
24
|
+
type: "geojson",
|
|
25
|
+
data: props.data,
|
|
26
|
+
cluster: true,
|
|
27
|
+
clusterRadius: props.clusterRadius,
|
|
28
|
+
clusterMaxZoom: props.clusterMaxZoom
|
|
29
|
+
}));
|
|
30
|
+
const specs = computed(() => clusterLayerSpecs({
|
|
31
|
+
id,
|
|
32
|
+
sourceId: id,
|
|
33
|
+
clusterPaint: props.clusterPaint,
|
|
34
|
+
countLayout: props.countLayout,
|
|
35
|
+
countPaint: props.countPaint,
|
|
36
|
+
pointPaint: props.pointPaint
|
|
37
|
+
}));
|
|
38
|
+
function onClusterClick(event) {
|
|
39
|
+
const map = ctx.map.value;
|
|
40
|
+
const feature = event.features?.[0];
|
|
41
|
+
const clusterId = feature?.properties?.cluster_id;
|
|
42
|
+
if (!map || !feature || clusterId === void 0) return;
|
|
43
|
+
const coordinates = feature.geometry.coordinates;
|
|
44
|
+
const geojsonSource = map.getSource(id);
|
|
45
|
+
geojsonSource.getClusterExpansionZoom(clusterId).then((expansionZoom) => {
|
|
46
|
+
if (props.autoExpand) map.easeTo({ center: coordinates, zoom: expansionZoom });
|
|
47
|
+
emit("clusterClick", { clusterId, coordinates, expansionZoom });
|
|
48
|
+
}).catch((error) => logger.warn("Failed to get cluster expansion zoom", error));
|
|
49
|
+
}
|
|
50
|
+
function onPointClick(event) {
|
|
51
|
+
const feature = event.features?.[0];
|
|
52
|
+
if (feature) emit("pointClick", feature);
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<MaplibreSource :source-id="id" :source="source">
|
|
58
|
+
<MaplibreLayer
|
|
59
|
+
:layer-id="specs.clusters.id"
|
|
60
|
+
type="circle"
|
|
61
|
+
:source="id"
|
|
62
|
+
:filter="specs.clusters.filter"
|
|
63
|
+
:paint="specs.clusters.paint"
|
|
64
|
+
:before-id="beforeId"
|
|
65
|
+
@click="onClusterClick"
|
|
66
|
+
/>
|
|
67
|
+
<MaplibreLayer
|
|
68
|
+
:layer-id="specs.count.id"
|
|
69
|
+
type="symbol"
|
|
70
|
+
:source="id"
|
|
71
|
+
:filter="specs.count.filter"
|
|
72
|
+
:layout="specs.count.layout"
|
|
73
|
+
:paint="specs.count.paint"
|
|
74
|
+
:before-id="beforeId"
|
|
75
|
+
/>
|
|
76
|
+
<MaplibreLayer
|
|
77
|
+
:layer-id="specs.points.id"
|
|
78
|
+
type="circle"
|
|
79
|
+
:source="id"
|
|
80
|
+
:filter="specs.points.filter"
|
|
81
|
+
:paint="specs.points.paint"
|
|
82
|
+
:before-id="beforeId"
|
|
83
|
+
@click="onPointClick"
|
|
84
|
+
/>
|
|
85
|
+
</MaplibreSource>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { MapGeoJSONFeature } from 'maplibre-gl';
|
|
2
|
+
import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
3
|
+
type PropBag = Record<string, unknown>;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** 点要素数据(GeoJSON 或其 URL) */
|
|
6
|
+
data: GeoJSONSourceSpecification['data'];
|
|
7
|
+
/** source 与图层 id 前缀;省略时自动生成 */
|
|
8
|
+
sourceId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 聚合半径(像素)
|
|
11
|
+
* @defaultValue 50
|
|
12
|
+
*/
|
|
13
|
+
clusterRadius?: number;
|
|
14
|
+
/**
|
|
15
|
+
* 超过该缩放级别不再聚合
|
|
16
|
+
* @defaultValue 14
|
|
17
|
+
*/
|
|
18
|
+
clusterMaxZoom?: number;
|
|
19
|
+
/** 覆盖聚合圆 paint */
|
|
20
|
+
clusterPaint?: PropBag;
|
|
21
|
+
/** 覆盖计数文字 layout */
|
|
22
|
+
countLayout?: PropBag;
|
|
23
|
+
/** 覆盖计数文字 paint */
|
|
24
|
+
countPaint?: PropBag;
|
|
25
|
+
/** 覆盖散点 paint */
|
|
26
|
+
pointPaint?: PropBag;
|
|
27
|
+
/**
|
|
28
|
+
* 点击聚合圆自动放大到展开级别
|
|
29
|
+
* @defaultValue true
|
|
30
|
+
*/
|
|
31
|
+
autoExpand?: boolean;
|
|
32
|
+
/** 插入到该图层之前 */
|
|
33
|
+
beforeId?: string;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
clusterClick: (payload: {
|
|
37
|
+
clusterId: number;
|
|
38
|
+
coordinates: [number, number];
|
|
39
|
+
expansionZoom: number;
|
|
40
|
+
}) => any;
|
|
41
|
+
pointClick: (feature: MapGeoJSONFeature) => any;
|
|
42
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
43
|
+
onClusterClick?: ((payload: {
|
|
44
|
+
clusterId: number;
|
|
45
|
+
coordinates: [number, number];
|
|
46
|
+
expansionZoom: number;
|
|
47
|
+
}) => any) | undefined;
|
|
48
|
+
onPointClick?: ((feature: MapGeoJSONFeature) => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
clusterRadius: number;
|
|
51
|
+
clusterMaxZoom: number;
|
|
52
|
+
autoExpand: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const _default: typeof __VLS_export;
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ImageSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 图层 id;省略时自动生成 */
|
|
4
|
+
layerId?: string;
|
|
5
|
+
/** 图片地址 */
|
|
6
|
+
url: string;
|
|
7
|
+
/** 四角经纬度:左上/右上/右下/左下 */
|
|
8
|
+
coordinates: ImageSourceSpecification['coordinates'];
|
|
9
|
+
/**
|
|
10
|
+
* 不透明度
|
|
11
|
+
* @defaultValue 1
|
|
12
|
+
*/
|
|
13
|
+
opacity?: number;
|
|
14
|
+
/** 插入到该图层之前 */
|
|
15
|
+
beforeId?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
opacity: number;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useId } from "vue";
|
|
3
|
+
import MaplibreSource from "../Source.vue";
|
|
4
|
+
import MaplibreLayer from "../Layer.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
layerId: { type: String, required: false },
|
|
7
|
+
url: { type: String, required: true },
|
|
8
|
+
coordinates: { type: Array, required: true },
|
|
9
|
+
opacity: { type: Number, required: false, default: 1 },
|
|
10
|
+
beforeId: { type: String, required: false }
|
|
11
|
+
});
|
|
12
|
+
const id = props.layerId ?? `movk-image-${useId()}`;
|
|
13
|
+
const source = computed(() => ({
|
|
14
|
+
type: "image",
|
|
15
|
+
url: props.url,
|
|
16
|
+
coordinates: props.coordinates
|
|
17
|
+
}));
|
|
18
|
+
const paint = computed(() => ({ "raster-opacity": props.opacity }));
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<MaplibreSource :source-id="id" :source="source">
|
|
23
|
+
<MaplibreLayer :layer-id="id" type="raster" :source="id" :paint="paint" :before-id="beforeId" />
|
|
24
|
+
</MaplibreSource>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ImageSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 图层 id;省略时自动生成 */
|
|
4
|
+
layerId?: string;
|
|
5
|
+
/** 图片地址 */
|
|
6
|
+
url: string;
|
|
7
|
+
/** 四角经纬度:左上/右上/右下/左下 */
|
|
8
|
+
coordinates: ImageSourceSpecification['coordinates'];
|
|
9
|
+
/**
|
|
10
|
+
* 不透明度
|
|
11
|
+
* @defaultValue 1
|
|
12
|
+
*/
|
|
13
|
+
opacity?: number;
|
|
14
|
+
/** 插入到该图层之前 */
|
|
15
|
+
beforeId?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
opacity: number;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 图层 id;省略时自动生成 */
|
|
3
|
+
layerId?: string;
|
|
4
|
+
/** URL 模板瓦片地址({z}/{x}/{y} 占位) */
|
|
5
|
+
tiles: string[];
|
|
6
|
+
/**
|
|
7
|
+
* 瓦片尺寸
|
|
8
|
+
* @defaultValue 256
|
|
9
|
+
*/
|
|
10
|
+
tileSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* 瓦片坐标方案
|
|
13
|
+
* @defaultValue 'xyz'
|
|
14
|
+
*/
|
|
15
|
+
scheme?: 'xyz' | 'tms';
|
|
16
|
+
/** 数据源最小缩放级别 */
|
|
17
|
+
minzoom?: number;
|
|
18
|
+
/** 数据源最大缩放级别 */
|
|
19
|
+
maxzoom?: number;
|
|
20
|
+
/** 版权信息 */
|
|
21
|
+
attribution?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 不透明度
|
|
24
|
+
* @defaultValue 1
|
|
25
|
+
*/
|
|
26
|
+
opacity?: number;
|
|
27
|
+
/** 插入到该图层之前 */
|
|
28
|
+
beforeId?: string;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
31
|
+
opacity: number;
|
|
32
|
+
tileSize: number;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useId } from "vue";
|
|
3
|
+
import { omitUndefined } from "@movk/core";
|
|
4
|
+
import MaplibreSource from "../Source.vue";
|
|
5
|
+
import MaplibreLayer from "../Layer.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
layerId: { type: String, required: false },
|
|
8
|
+
tiles: { type: Array, required: true },
|
|
9
|
+
tileSize: { type: Number, required: false, default: 256 },
|
|
10
|
+
scheme: { type: String, required: false },
|
|
11
|
+
minzoom: { type: Number, required: false },
|
|
12
|
+
maxzoom: { type: Number, required: false },
|
|
13
|
+
attribution: { type: String, required: false },
|
|
14
|
+
opacity: { type: Number, required: false, default: 1 },
|
|
15
|
+
beforeId: { type: String, required: false }
|
|
16
|
+
});
|
|
17
|
+
const id = props.layerId ?? `movk-raster-${useId()}`;
|
|
18
|
+
const source = computed(() => omitUndefined({
|
|
19
|
+
type: "raster",
|
|
20
|
+
tiles: props.tiles,
|
|
21
|
+
tileSize: props.tileSize,
|
|
22
|
+
scheme: props.scheme,
|
|
23
|
+
minzoom: props.minzoom,
|
|
24
|
+
maxzoom: props.maxzoom,
|
|
25
|
+
attribution: props.attribution
|
|
26
|
+
}));
|
|
27
|
+
const paint = computed(() => ({ "raster-opacity": props.opacity }));
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<MaplibreSource :source-id="id" :source="source">
|
|
32
|
+
<MaplibreLayer :layer-id="id" type="raster" :source="id" :paint="paint" :before-id="beforeId" />
|
|
33
|
+
</MaplibreSource>
|
|
34
|
+
</template>
|