@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.
Files changed (256) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +192 -0
  3. package/README.md +191 -0
  4. package/dist/module.d.mts +20 -0
  5. package/dist/module.d.ts +20 -0
  6. package/dist/module.json +12 -0
  7. package/dist/module.mjs +63 -0
  8. package/dist/runtime/components/CustomLayer.d.vue.ts +24 -0
  9. package/dist/runtime/components/CustomLayer.vue +23 -0
  10. package/dist/runtime/components/CustomLayer.vue.d.ts +24 -0
  11. package/dist/runtime/components/Layer.d.vue.ts +75 -0
  12. package/dist/runtime/components/Layer.vue +112 -0
  13. package/dist/runtime/components/Layer.vue.d.ts +75 -0
  14. package/dist/runtime/components/LayerGroup.d.vue.ts +25 -0
  15. package/dist/runtime/components/LayerGroup.vue +16 -0
  16. package/dist/runtime/components/LayerGroup.vue.d.ts +25 -0
  17. package/dist/runtime/components/LottieMarker.d.vue.ts +50 -0
  18. package/dist/runtime/components/LottieMarker.vue +31 -0
  19. package/dist/runtime/components/LottieMarker.vue.d.ts +50 -0
  20. package/dist/runtime/components/Map.d.vue.ts +84 -0
  21. package/dist/runtime/components/Map.vue +134 -0
  22. package/dist/runtime/components/Map.vue.d.ts +84 -0
  23. package/dist/runtime/components/Marker.d.vue.ts +54 -0
  24. package/dist/runtime/components/Marker.vue +86 -0
  25. package/dist/runtime/components/Marker.vue.d.ts +54 -0
  26. package/dist/runtime/components/Popup.d.vue.ts +30 -0
  27. package/dist/runtime/components/Popup.vue +33 -0
  28. package/dist/runtime/components/Popup.vue.d.ts +30 -0
  29. package/dist/runtime/components/Source.d.vue.ts +23 -0
  30. package/dist/runtime/components/Source.vue +44 -0
  31. package/dist/runtime/components/Source.vue.d.ts +23 -0
  32. package/dist/runtime/components/Tooltip.d.vue.ts +45 -0
  33. package/dist/runtime/components/Tooltip.vue +106 -0
  34. package/dist/runtime/components/Tooltip.vue.d.ts +45 -0
  35. package/dist/runtime/components/buffers/BufferCircle.d.vue.ts +27 -0
  36. package/dist/runtime/components/buffers/BufferCircle.vue +30 -0
  37. package/dist/runtime/components/buffers/BufferCircle.vue.d.ts +27 -0
  38. package/dist/runtime/components/buffers/BufferEllipse.d.vue.ts +35 -0
  39. package/dist/runtime/components/buffers/BufferEllipse.vue +36 -0
  40. package/dist/runtime/components/buffers/BufferEllipse.vue.d.ts +35 -0
  41. package/dist/runtime/components/buffers/BufferLine.d.vue.ts +21 -0
  42. package/dist/runtime/components/buffers/BufferLine.vue +40 -0
  43. package/dist/runtime/components/buffers/BufferLine.vue.d.ts +21 -0
  44. package/dist/runtime/components/buffers/BufferPolygon.d.vue.ts +21 -0
  45. package/dist/runtime/components/buffers/BufferPolygon.vue +40 -0
  46. package/dist/runtime/components/buffers/BufferPolygon.vue.d.ts +21 -0
  47. package/dist/runtime/components/buffers/BufferSector.d.vue.ts +31 -0
  48. package/dist/runtime/components/buffers/BufferSector.vue +35 -0
  49. package/dist/runtime/components/buffers/BufferSector.vue.d.ts +31 -0
  50. package/dist/runtime/components/controls/AttributionControl.d.vue.ts +24 -0
  51. package/dist/runtime/components/controls/AttributionControl.vue +18 -0
  52. package/dist/runtime/components/controls/AttributionControl.vue.d.ts +24 -0
  53. package/dist/runtime/components/controls/FullscreenControl.d.vue.ts +24 -0
  54. package/dist/runtime/components/controls/FullscreenControl.vue +18 -0
  55. package/dist/runtime/components/controls/FullscreenControl.vue.d.ts +24 -0
  56. package/dist/runtime/components/controls/GeolocateControl.d.vue.ts +24 -0
  57. package/dist/runtime/components/controls/GeolocateControl.vue +18 -0
  58. package/dist/runtime/components/controls/GeolocateControl.vue.d.ts +24 -0
  59. package/dist/runtime/components/controls/NavigationControl.d.vue.ts +24 -0
  60. package/dist/runtime/components/controls/NavigationControl.vue +18 -0
  61. package/dist/runtime/components/controls/NavigationControl.vue.d.ts +24 -0
  62. package/dist/runtime/components/controls/ScaleControl.d.vue.ts +24 -0
  63. package/dist/runtime/components/controls/ScaleControl.vue +18 -0
  64. package/dist/runtime/components/controls/ScaleControl.vue.d.ts +24 -0
  65. package/dist/runtime/components/effects/AnimatedImage.d.vue.ts +28 -0
  66. package/dist/runtime/components/effects/AnimatedImage.vue +50 -0
  67. package/dist/runtime/components/effects/AnimatedImage.vue.d.ts +28 -0
  68. package/dist/runtime/components/effects/DiffusionCircle.d.vue.ts +44 -0
  69. package/dist/runtime/components/effects/DiffusionCircle.vue +47 -0
  70. package/dist/runtime/components/effects/DiffusionCircle.vue.d.ts +44 -0
  71. package/dist/runtime/components/effects/FlowBuilding.d.vue.ts +53 -0
  72. package/dist/runtime/components/effects/FlowBuilding.vue +64 -0
  73. package/dist/runtime/components/effects/FlowBuilding.vue.d.ts +53 -0
  74. package/dist/runtime/components/effects/GlowCircle.d.vue.ts +44 -0
  75. package/dist/runtime/components/effects/GlowCircle.vue +42 -0
  76. package/dist/runtime/components/effects/GlowCircle.vue.d.ts +44 -0
  77. package/dist/runtime/components/effects/GradientBuilding.d.vue.ts +25 -0
  78. package/dist/runtime/components/effects/GradientBuilding.vue +37 -0
  79. package/dist/runtime/components/effects/GradientBuilding.vue.d.ts +25 -0
  80. package/dist/runtime/components/effects/Migration.d.vue.ts +50 -0
  81. package/dist/runtime/components/effects/Migration.vue +90 -0
  82. package/dist/runtime/components/effects/Migration.vue.d.ts +50 -0
  83. package/dist/runtime/components/effects/Radar.d.vue.ts +32 -0
  84. package/dist/runtime/components/effects/Radar.vue +49 -0
  85. package/dist/runtime/components/effects/Radar.vue.d.ts +32 -0
  86. package/dist/runtime/components/effects/SpriteImage.d.vue.ts +41 -0
  87. package/dist/runtime/components/effects/SpriteImage.vue +67 -0
  88. package/dist/runtime/components/effects/SpriteImage.vue.d.ts +41 -0
  89. package/dist/runtime/components/effects/TextureBuilding.d.vue.ts +25 -0
  90. package/dist/runtime/components/effects/TextureBuilding.vue +39 -0
  91. package/dist/runtime/components/effects/TextureBuilding.vue.d.ts +25 -0
  92. package/dist/runtime/components/effects/Trail.d.vue.ts +44 -0
  93. package/dist/runtime/components/effects/Trail.vue +61 -0
  94. package/dist/runtime/components/effects/Trail.vue.d.ts +44 -0
  95. package/dist/runtime/components/effects/WaveCircle.d.vue.ts +44 -0
  96. package/dist/runtime/components/effects/WaveCircle.vue +55 -0
  97. package/dist/runtime/components/effects/WaveCircle.vue.d.ts +44 -0
  98. package/dist/runtime/components/effects/WindowBuilding.d.vue.ts +53 -0
  99. package/dist/runtime/components/effects/WindowBuilding.vue +61 -0
  100. package/dist/runtime/components/effects/WindowBuilding.vue.d.ts +53 -0
  101. package/dist/runtime/components/environment/Sky.d.vue.ts +21 -0
  102. package/dist/runtime/components/environment/Sky.vue +15 -0
  103. package/dist/runtime/components/environment/Sky.vue.d.ts +21 -0
  104. package/dist/runtime/components/environment/Temperature.d.vue.ts +47 -0
  105. package/dist/runtime/components/environment/Temperature.vue +41 -0
  106. package/dist/runtime/components/environment/Temperature.vue.d.ts +47 -0
  107. package/dist/runtime/components/environment/Terrain.d.vue.ts +34 -0
  108. package/dist/runtime/components/environment/Terrain.vue +47 -0
  109. package/dist/runtime/components/environment/Terrain.vue.d.ts +34 -0
  110. package/dist/runtime/components/extensions/DrawControl.d.vue.ts +0 -0
  111. package/dist/runtime/components/extensions/DrawControl.vue +168 -0
  112. package/dist/runtime/components/extensions/DrawControl.vue.d.ts +0 -0
  113. package/dist/runtime/components/extensions/TiandituLayer.d.vue.ts +20 -0
  114. package/dist/runtime/components/extensions/TiandituLayer.vue +26 -0
  115. package/dist/runtime/components/extensions/TiandituLayer.vue.d.ts +20 -0
  116. package/dist/runtime/components/extensions/WmsLayer.d.vue.ts +50 -0
  117. package/dist/runtime/components/extensions/WmsLayer.vue +39 -0
  118. package/dist/runtime/components/extensions/WmsLayer.vue.d.ts +50 -0
  119. package/dist/runtime/components/extensions/WmtsLayer.d.vue.ts +42 -0
  120. package/dist/runtime/components/extensions/WmtsLayer.vue +37 -0
  121. package/dist/runtime/components/extensions/WmtsLayer.vue.d.ts +42 -0
  122. package/dist/runtime/components/layers/BuildingLayer.d.vue.ts +28 -0
  123. package/dist/runtime/components/layers/BuildingLayer.vue +41 -0
  124. package/dist/runtime/components/layers/BuildingLayer.vue.d.ts +28 -0
  125. package/dist/runtime/components/layers/ClusterLayer.d.vue.ts +55 -0
  126. package/dist/runtime/components/layers/ClusterLayer.vue +86 -0
  127. package/dist/runtime/components/layers/ClusterLayer.vue.d.ts +55 -0
  128. package/dist/runtime/components/layers/ImageLayer.d.vue.ts +21 -0
  129. package/dist/runtime/components/layers/ImageLayer.vue +25 -0
  130. package/dist/runtime/components/layers/ImageLayer.vue.d.ts +21 -0
  131. package/dist/runtime/components/layers/RasterLayer.d.vue.ts +35 -0
  132. package/dist/runtime/components/layers/RasterLayer.vue +34 -0
  133. package/dist/runtime/components/layers/RasterLayer.vue.d.ts +35 -0
  134. package/dist/runtime/components/layers/VideoLayer.d.vue.ts +28 -0
  135. package/dist/runtime/components/layers/VideoLayer.vue +38 -0
  136. package/dist/runtime/components/layers/VideoLayer.vue.d.ts +28 -0
  137. package/dist/runtime/composables/defineMaplibreControl.d.ts +3 -0
  138. package/dist/runtime/composables/defineMaplibreControl.js +6 -0
  139. package/dist/runtime/composables/useFeatureState.d.ts +35 -0
  140. package/dist/runtime/composables/useFeatureState.js +76 -0
  141. package/dist/runtime/composables/useFrameIcon.d.ts +17 -0
  142. package/dist/runtime/composables/useFrameIcon.js +36 -0
  143. package/dist/runtime/composables/useMap.d.ts +3 -0
  144. package/dist/runtime/composables/useMap.js +9 -0
  145. package/dist/runtime/composables/useMapAnimation.d.ts +21 -0
  146. package/dist/runtime/composables/useMapAnimation.js +13 -0
  147. package/dist/runtime/composables/useMapExport.d.ts +34 -0
  148. package/dist/runtime/composables/useMapExport.js +35 -0
  149. package/dist/runtime/composables/useMaplibre.d.ts +6 -0
  150. package/dist/runtime/composables/useMaplibre.js +4 -0
  151. package/dist/runtime/composables/useMaplibreCamera.d.ts +15 -0
  152. package/dist/runtime/composables/useMaplibreCamera.js +32 -0
  153. package/dist/runtime/composables/useMaplibreDraw.d.ts +10 -0
  154. package/dist/runtime/composables/useMaplibreDraw.js +34 -0
  155. package/dist/runtime/composables/useMaplibreImage.d.ts +19 -0
  156. package/dist/runtime/composables/useMaplibreImage.js +33 -0
  157. package/dist/runtime/composables/useMeasure.d.ts +25 -0
  158. package/dist/runtime/composables/useMeasure.js +173 -0
  159. package/dist/runtime/domains/map/config.d.ts +7 -0
  160. package/dist/runtime/domains/map/config.js +13 -0
  161. package/dist/runtime/domains/map/context.d.ts +13 -0
  162. package/dist/runtime/domains/map/context.js +51 -0
  163. package/dist/runtime/domains/map/control.d.ts +4 -0
  164. package/dist/runtime/domains/map/control.js +28 -0
  165. package/dist/runtime/domains/map/create-map.d.ts +3 -0
  166. package/dist/runtime/domains/map/create-map.js +21 -0
  167. package/dist/runtime/domains/map/draw-context.d.ts +26 -0
  168. package/dist/runtime/domains/map/draw-context.js +73 -0
  169. package/dist/runtime/domains/map/draw-registry.d.ts +5 -0
  170. package/dist/runtime/domains/map/draw-registry.js +15 -0
  171. package/dist/runtime/domains/map/draw-toolbar.d.ts +15 -0
  172. package/dist/runtime/domains/map/draw-toolbar.js +52 -0
  173. package/dist/runtime/domains/map/draw.d.ts +4 -0
  174. package/dist/runtime/domains/map/draw.js +1 -0
  175. package/dist/runtime/domains/map/layer-group.d.ts +9 -0
  176. package/dist/runtime/domains/map/layer-group.js +1 -0
  177. package/dist/runtime/domains/map/registry.d.ts +4 -0
  178. package/dist/runtime/domains/map/registry.js +10 -0
  179. package/dist/runtime/domains/map/resolve.d.ts +7 -0
  180. package/dist/runtime/domains/map/resolve.js +7 -0
  181. package/dist/runtime/domains/map/style-effect.d.ts +6 -0
  182. package/dist/runtime/domains/map/style-effect.js +21 -0
  183. package/dist/runtime/draw-modes/index.d.ts +16 -0
  184. package/dist/runtime/draw-modes/index.js +32 -0
  185. package/dist/runtime/index.css +1 -0
  186. package/dist/runtime/plugins/config.d.ts +2 -0
  187. package/dist/runtime/plugins/config.js +6 -0
  188. package/dist/runtime/types/draw.d.ts +30 -0
  189. package/dist/runtime/types/draw.js +0 -0
  190. package/dist/runtime/types/index.d.ts +3 -0
  191. package/dist/runtime/types/index.js +0 -0
  192. package/dist/runtime/types/map.d.ts +45 -0
  193. package/dist/runtime/types/map.js +0 -0
  194. package/dist/runtime/types/tianditu.d.ts +247 -0
  195. package/dist/runtime/types/tianditu.js +0 -0
  196. package/dist/runtime/utils/animated-image.d.ts +13 -0
  197. package/dist/runtime/utils/animated-image.js +47 -0
  198. package/dist/runtime/utils/buffer.d.ts +24 -0
  199. package/dist/runtime/utils/buffer.js +13 -0
  200. package/dist/runtime/utils/building-effects.d.ts +73 -0
  201. package/dist/runtime/utils/building-effects.js +50 -0
  202. package/dist/runtime/utils/building.d.ts +53 -0
  203. package/dist/runtime/utils/building.js +26 -0
  204. package/dist/runtime/utils/cluster.d.ts +24 -0
  205. package/dist/runtime/utils/cluster.js +42 -0
  206. package/dist/runtime/utils/coordinate.d.ts +12 -0
  207. package/dist/runtime/utils/coordinate.js +44 -0
  208. package/dist/runtime/utils/draw-theme.d.ts +47 -0
  209. package/dist/runtime/utils/draw-theme.js +39 -0
  210. package/dist/runtime/utils/effects.d.ts +34 -0
  211. package/dist/runtime/utils/effects.js +78 -0
  212. package/dist/runtime/utils/events.d.ts +6 -0
  213. package/dist/runtime/utils/events.js +20 -0
  214. package/dist/runtime/utils/frame-icon.d.ts +27 -0
  215. package/dist/runtime/utils/frame-icon.js +45 -0
  216. package/dist/runtime/utils/geometry.d.ts +5 -0
  217. package/dist/runtime/utils/geometry.js +41 -0
  218. package/dist/runtime/utils/heatmap.d.ts +36 -0
  219. package/dist/runtime/utils/heatmap.js +30 -0
  220. package/dist/runtime/utils/layer.d.ts +13 -0
  221. package/dist/runtime/utils/layer.js +17 -0
  222. package/dist/runtime/utils/logger.d.ts +2 -0
  223. package/dist/runtime/utils/logger.js +2 -0
  224. package/dist/runtime/utils/measure.d.ts +4 -0
  225. package/dist/runtime/utils/measure.js +8 -0
  226. package/dist/runtime/utils/sprite.d.ts +31 -0
  227. package/dist/runtime/utils/sprite.js +23 -0
  228. package/dist/runtime/utils/tianditu-administrative.d.ts +3 -0
  229. package/dist/runtime/utils/tianditu-administrative.js +48 -0
  230. package/dist/runtime/utils/tianditu-client.d.ts +30 -0
  231. package/dist/runtime/utils/tianditu-client.js +17 -0
  232. package/dist/runtime/utils/tianditu-geocoder.d.ts +5 -0
  233. package/dist/runtime/utils/tianditu-geocoder.js +37 -0
  234. package/dist/runtime/utils/tianditu-request.d.ts +20 -0
  235. package/dist/runtime/utils/tianditu-request.js +42 -0
  236. package/dist/runtime/utils/tianditu-route.d.ts +3 -0
  237. package/dist/runtime/utils/tianditu-route.js +40 -0
  238. package/dist/runtime/utils/tianditu-search.d.ts +15 -0
  239. package/dist/runtime/utils/tianditu-search.js +183 -0
  240. package/dist/runtime/utils/tianditu.d.ts +21 -0
  241. package/dist/runtime/utils/tianditu.js +26 -0
  242. package/dist/runtime/utils/wms.d.ts +43 -0
  243. package/dist/runtime/utils/wms.js +30 -0
  244. package/dist/runtime/utils/wmts.d.ts +35 -0
  245. package/dist/runtime/utils/wmts.js +29 -0
  246. package/dist/types.d.mts +5 -0
  247. package/dist/unplugin.d.mts +30 -0
  248. package/dist/unplugin.d.ts +30 -0
  249. package/dist/unplugin.mjs +53 -0
  250. package/dist/vite.d.mts +7 -0
  251. package/dist/vite.d.ts +7 -0
  252. package/dist/vite.mjs +11 -0
  253. package/dist/vue-plugin.d.mts +9 -0
  254. package/dist/vue-plugin.d.ts +9 -0
  255. package/dist/vue-plugin.mjs +9 -0
  256. package/package.json +174 -0
@@ -0,0 +1,64 @@
1
+ <script setup>
2
+ import { computed, useId } from "vue";
3
+ import { buildingGradientPaint } from "../../utils/building-effects";
4
+ import { useMapAnimation } from "../../composables/useMapAnimation";
5
+ import { DEFAULT_HEIGHT_PROPERTY } from "../../utils/building";
6
+ import MaplibreBuildingLayer from "../layers/BuildingLayer.vue";
7
+ const props = defineProps({
8
+ source: { type: String, required: true },
9
+ sourceLayer: { type: String, required: false },
10
+ heightProperty: { type: String, required: false },
11
+ baseProperty: { type: String, required: false },
12
+ layerId: { type: String, required: false },
13
+ color: { type: String, required: false, default: "#1e3a8a" },
14
+ flowColor: { type: String, required: false, default: "#67e8f9" },
15
+ duration: { type: Number, required: false, default: 3e3 },
16
+ bandHeight: { type: Number, required: false, default: 60 },
17
+ maxHeight: { type: Number, required: false, default: 300 },
18
+ opacity: { type: Number, required: false },
19
+ minzoom: { type: Number, required: false, default: 15 },
20
+ beforeId: { type: String, required: false }
21
+ });
22
+ const id = props.layerId ?? `movk-flow-building-${useId()}`;
23
+ const initialPaint = computed(() => buildingGradientPaint({
24
+ stops: [[0, props.color], [props.maxHeight, props.color]],
25
+ opacity: props.opacity,
26
+ minzoom: props.minzoom,
27
+ heightProperty: props.heightProperty,
28
+ baseProperty: props.baseProperty
29
+ }));
30
+ useMapAnimation((map, elapsed) => {
31
+ if (!map.getLayer(id)) return;
32
+ const center = elapsed % props.duration / props.duration * props.maxHeight;
33
+ const lo = Math.max(center - props.bandHeight / 2, 0);
34
+ const hi = center + props.bandHeight / 2;
35
+ map.setPaintProperty(id, "fill-extrusion-color", [
36
+ "interpolate",
37
+ ["linear"],
38
+ ["get", props.heightProperty ?? DEFAULT_HEIGHT_PROPERTY],
39
+ Math.max(lo - 1, 0),
40
+ props.color,
41
+ lo,
42
+ props.color,
43
+ center,
44
+ props.flowColor,
45
+ hi,
46
+ props.color,
47
+ hi + 1,
48
+ props.color
49
+ ]);
50
+ });
51
+ </script>
52
+
53
+ <template>
54
+ <MaplibreBuildingLayer
55
+ :layer-id="id"
56
+ :source="source"
57
+ :source-layer="sourceLayer"
58
+ :height-property="heightProperty"
59
+ :base-property="baseProperty"
60
+ :minzoom="minzoom"
61
+ :paint="initialPaint"
62
+ :before-id="beforeId"
63
+ />
64
+ </template>
@@ -0,0 +1,53 @@
1
+ import type { BuildingSourceOptions } from '../../utils/building';
2
+ /** 流动建筑:渐变着色 + 高亮带沿建筑高度循环流动。 */
3
+ type __VLS_Props = BuildingSourceOptions & {
4
+ /** 图层 id;省略时自动生成 */
5
+ layerId?: string;
6
+ /**
7
+ * 基色
8
+ * @defaultValue '#1e3a8a'
9
+ */
10
+ color?: string;
11
+ /**
12
+ * 流动高亮色
13
+ * @defaultValue '#67e8f9'
14
+ */
15
+ flowColor?: string;
16
+ /**
17
+ * 流动周期(毫秒)
18
+ * @defaultValue 3000
19
+ */
20
+ duration?: number;
21
+ /**
22
+ * 高亮带覆盖的高度范围(米)
23
+ * @defaultValue 60
24
+ */
25
+ bandHeight?: number;
26
+ /**
27
+ * 建筑最大参考高度(米)
28
+ * @defaultValue 300
29
+ */
30
+ maxHeight?: number;
31
+ /**
32
+ * 整体透明度
33
+ * @defaultValue 0.85
34
+ */
35
+ opacity?: number;
36
+ /**
37
+ * 最小缩放级别
38
+ * @defaultValue 15
39
+ */
40
+ minzoom?: number;
41
+ /** 插入到该图层之前 */
42
+ beforeId?: string;
43
+ };
44
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
45
+ minzoom: number;
46
+ color: string;
47
+ duration: number;
48
+ flowColor: string;
49
+ bandHeight: number;
50
+ maxHeight: number;
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
+ declare const _default: typeof __VLS_export;
53
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 炫光圆:实心内核 + 模糊光晕,可选呼吸脉冲。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 图层 id 前缀;省略时自动生成 */
7
+ layerId?: string;
8
+ /**
9
+ * 主色
10
+ * @defaultValue '#f59e0b'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 内核半径(像素)
15
+ * @defaultValue 6
16
+ */
17
+ radius?: number;
18
+ /**
19
+ * 光晕半径倍数
20
+ * @defaultValue 3
21
+ */
22
+ glowScale?: number;
23
+ /**
24
+ * 呼吸脉冲(光晕半径 ±25% 正弦摆动)
25
+ * @defaultValue false
26
+ */
27
+ pulse?: boolean;
28
+ /**
29
+ * 脉冲周期(毫秒)
30
+ * @defaultValue 2000
31
+ */
32
+ duration?: number;
33
+ /** 插入到该图层之前 */
34
+ beforeId?: string;
35
+ };
36
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
37
+ color: string;
38
+ radius: number;
39
+ duration: number;
40
+ glowScale: number;
41
+ pulse: boolean;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
@@ -0,0 +1,42 @@
1
+ <script setup>
2
+ import { computed, useId } from "vue";
3
+ import { useMapAnimation } from "../../composables/useMapAnimation";
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
+ color: { type: String, required: false, default: "#f59e0b" },
10
+ radius: { type: Number, required: false, default: 6 },
11
+ glowScale: { type: Number, required: false, default: 3 },
12
+ pulse: { type: Boolean, required: false, default: false },
13
+ duration: { type: Number, required: false, default: 2e3 },
14
+ beforeId: { type: String, required: false }
15
+ });
16
+ const id = props.layerId ?? `movk-glow-${useId()}`;
17
+ const source = computed(() => ({ type: "geojson", data: props.data }));
18
+ const glowRadius = computed(() => props.radius * props.glowScale);
19
+ const glowPaint = computed(() => ({
20
+ "circle-color": props.color,
21
+ "circle-radius": glowRadius.value,
22
+ "circle-blur": 1,
23
+ "circle-opacity": 0.7
24
+ }));
25
+ const corePaint = computed(() => ({
26
+ "circle-color": props.color,
27
+ "circle-radius": props.radius
28
+ }));
29
+ useMapAnimation((map, elapsed) => {
30
+ const layerId = `${id}-glow`;
31
+ if (!map.getLayer(layerId)) return;
32
+ const wave = Math.sin(elapsed / props.duration * Math.PI * 2);
33
+ map.setPaintProperty(layerId, "circle-radius", glowRadius.value * (1 + wave * 0.25));
34
+ }, { immediate: props.pulse });
35
+ </script>
36
+
37
+ <template>
38
+ <MaplibreSource :source-id="id" :source="source">
39
+ <MaplibreLayer :layer-id="`${id}-glow`" type="circle" :source="id" :paint="glowPaint" :before-id="beforeId" />
40
+ <MaplibreLayer :layer-id="`${id}-core`" type="circle" :source="id" :paint="corePaint" :before-id="beforeId" />
41
+ </MaplibreSource>
42
+ </template>
@@ -0,0 +1,44 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 炫光圆:实心内核 + 模糊光晕,可选呼吸脉冲。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 图层 id 前缀;省略时自动生成 */
7
+ layerId?: string;
8
+ /**
9
+ * 主色
10
+ * @defaultValue '#f59e0b'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 内核半径(像素)
15
+ * @defaultValue 6
16
+ */
17
+ radius?: number;
18
+ /**
19
+ * 光晕半径倍数
20
+ * @defaultValue 3
21
+ */
22
+ glowScale?: number;
23
+ /**
24
+ * 呼吸脉冲(光晕半径 ±25% 正弦摆动)
25
+ * @defaultValue false
26
+ */
27
+ pulse?: boolean;
28
+ /**
29
+ * 脉冲周期(毫秒)
30
+ * @defaultValue 2000
31
+ */
32
+ duration?: number;
33
+ /** 插入到该图层之前 */
34
+ beforeId?: string;
35
+ };
36
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
37
+ color: string;
38
+ radius: number;
39
+ duration: number;
40
+ glowScale: number;
41
+ pulse: boolean;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import type { BuildingSourceOptions } from '../../utils/building';
2
+ /** 渐变建筑:按高度插值着色的 3D 建筑。 */
3
+ type __VLS_Props = BuildingSourceOptions & {
4
+ /** 图层 id;省略时自动生成 */
5
+ layerId?: string;
6
+ /** 高度-颜色断点 */
7
+ stops?: [number, string][];
8
+ /**
9
+ * 整体透明度
10
+ * @defaultValue 0.85
11
+ */
12
+ opacity?: number;
13
+ /**
14
+ * 最小缩放级别
15
+ * @defaultValue 15
16
+ */
17
+ minzoom?: number;
18
+ /** 插入到该图层之前 */
19
+ beforeId?: string;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
+ minzoom: number;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,37 @@
1
+ <script setup>
2
+ import { computed, useId } from "vue";
3
+ import { buildingGradientPaint } from "../../utils/building-effects";
4
+ import MaplibreBuildingLayer from "../layers/BuildingLayer.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
+ stops: { type: Array, required: false },
12
+ opacity: { type: Number, required: false },
13
+ minzoom: { type: Number, required: false, default: 15 },
14
+ beforeId: { type: String, required: false }
15
+ });
16
+ const id = props.layerId ?? `movk-gradient-building-${useId()}`;
17
+ const paint = computed(() => buildingGradientPaint({
18
+ stops: props.stops,
19
+ opacity: props.opacity,
20
+ minzoom: props.minzoom,
21
+ heightProperty: props.heightProperty,
22
+ baseProperty: props.baseProperty
23
+ }));
24
+ </script>
25
+
26
+ <template>
27
+ <MaplibreBuildingLayer
28
+ :layer-id="id"
29
+ :source="source"
30
+ :source-layer="sourceLayer"
31
+ :height-property="heightProperty"
32
+ :base-property="baseProperty"
33
+ :minzoom="minzoom"
34
+ :paint="paint"
35
+ :before-id="beforeId"
36
+ />
37
+ </template>
@@ -0,0 +1,25 @@
1
+ import type { BuildingSourceOptions } from '../../utils/building';
2
+ /** 渐变建筑:按高度插值着色的 3D 建筑。 */
3
+ type __VLS_Props = BuildingSourceOptions & {
4
+ /** 图层 id;省略时自动生成 */
5
+ layerId?: string;
6
+ /** 高度-颜色断点 */
7
+ stops?: [number, string][];
8
+ /**
9
+ * 整体透明度
10
+ * @defaultValue 0.85
11
+ */
12
+ opacity?: number;
13
+ /**
14
+ * 最小缩放级别
15
+ * @defaultValue 15
16
+ */
17
+ minzoom?: number;
18
+ /** 插入到该图层之前 */
19
+ beforeId?: string;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
+ minzoom: number;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import { type Position2D } from '../../utils/effects';
2
+ export interface MigrationRoute {
3
+ from: Position2D;
4
+ to: Position2D;
5
+ /** 透传到弧线与粒子要素的属性 */
6
+ properties?: Record<string, unknown>;
7
+ }
8
+ /** 迁徙图:OD 对生成贝塞尔弧线,粒子沿线循环飞行 + 渐变尾迹。 */
9
+ type __VLS_Props = {
10
+ /** 起讫点对列表 */
11
+ data: MigrationRoute[];
12
+ /** 图层 id 前缀;省略时自动生成 */
13
+ layerId?: string;
14
+ /**
15
+ * 主色
16
+ * @defaultValue '#f43f5e'
17
+ */
18
+ color?: string;
19
+ /**
20
+ * 弧线弯曲程度
21
+ * @defaultValue 0.3
22
+ */
23
+ curvature?: number;
24
+ /**
25
+ * 单程飞行周期(毫秒)
26
+ * @defaultValue 3000
27
+ */
28
+ duration?: number;
29
+ /**
30
+ * 线宽(像素)
31
+ * @defaultValue 2
32
+ */
33
+ lineWidth?: number;
34
+ /**
35
+ * 粒子半径(像素)
36
+ * @defaultValue 4
37
+ */
38
+ particleRadius?: number;
39
+ /** 插入到该图层之前 */
40
+ beforeId?: string;
41
+ };
42
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
43
+ color: string;
44
+ duration: number;
45
+ curvature: number;
46
+ lineWidth: number;
47
+ particleRadius: number;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
+ declare const _default: typeof __VLS_export;
50
+ export default _default;
@@ -0,0 +1,90 @@
1
+ <script setup>
2
+ import { computed, useId } from "vue";
3
+ import { arcLine, createLineSampler } from "../../utils/effects";
4
+ import { useMapAnimation } from "../../composables/useMapAnimation";
5
+ import MaplibreSource from "../Source.vue";
6
+ import MaplibreLayer from "../Layer.vue";
7
+ const props = defineProps({
8
+ data: { type: Array, required: true },
9
+ layerId: { type: String, required: false },
10
+ color: { type: String, required: false, default: "#f43f5e" },
11
+ curvature: { type: Number, required: false, default: 0.3 },
12
+ duration: { type: Number, required: false, default: 3e3 },
13
+ lineWidth: { type: Number, required: false, default: 2 },
14
+ particleRadius: { type: Number, required: false, default: 4 },
15
+ beforeId: { type: String, required: false }
16
+ });
17
+ const id = props.layerId ?? `movk-migration-${useId()}`;
18
+ const linesId = `${id}-lines`;
19
+ const particlesId = `${id}-particles`;
20
+ const arcs = computed(() => props.data.map((route) => ({
21
+ coords: arcLine(route.from, route.to, { curvature: props.curvature }),
22
+ properties: route.properties ?? {}
23
+ })));
24
+ const samplers = computed(() => arcs.value.map((arc) => createLineSampler(arc.coords)));
25
+ const linesSource = computed(() => ({
26
+ type: "geojson",
27
+ lineMetrics: true,
28
+ data: {
29
+ type: "FeatureCollection",
30
+ features: arcs.value.map((arc) => ({
31
+ type: "Feature",
32
+ properties: arc.properties,
33
+ geometry: { type: "LineString", coordinates: arc.coords }
34
+ }))
35
+ }
36
+ }));
37
+ const particlesSource = {
38
+ type: "geojson",
39
+ data: { type: "FeatureCollection", features: [] }
40
+ };
41
+ const linePaint = computed(() => ({
42
+ "line-width": props.lineWidth,
43
+ "line-gradient": [
44
+ "interpolate",
45
+ ["linear"],
46
+ ["line-progress"],
47
+ 0,
48
+ "rgba(0, 0, 0, 0)",
49
+ 1,
50
+ props.color
51
+ ]
52
+ }));
53
+ const lineLayout = { "line-cap": "round", "line-join": "round" };
54
+ const particlePaint = computed(() => ({
55
+ "circle-color": "#ffffff",
56
+ "circle-radius": props.particleRadius,
57
+ "circle-stroke-color": props.color,
58
+ "circle-stroke-width": 2
59
+ }));
60
+ useMapAnimation((map, elapsed) => {
61
+ const source = map.getSource(particlesId);
62
+ if (!source) return;
63
+ const base = elapsed % props.duration / props.duration;
64
+ const features = samplers.value.map((sample, index) => {
65
+ const t = (base + index / Math.max(samplers.value.length, 1)) % 1;
66
+ return {
67
+ type: "Feature",
68
+ properties: arcs.value[index].properties,
69
+ geometry: { type: "Point", coordinates: sample(t) }
70
+ };
71
+ });
72
+ source.setData({ type: "FeatureCollection", features });
73
+ });
74
+ </script>
75
+
76
+ <template>
77
+ <MaplibreSource :source-id="linesId" :source="linesSource">
78
+ <MaplibreLayer
79
+ :layer-id="linesId"
80
+ type="line"
81
+ :source="linesId"
82
+ :layout="lineLayout"
83
+ :paint="linePaint"
84
+ :before-id="beforeId"
85
+ />
86
+ </MaplibreSource>
87
+ <MaplibreSource :source-id="particlesId" :source="particlesSource">
88
+ <MaplibreLayer :layer-id="particlesId" type="circle" :source="particlesId" :paint="particlePaint" :before-id="beforeId" />
89
+ </MaplibreSource>
90
+ </template>
@@ -0,0 +1,50 @@
1
+ import { type Position2D } from '../../utils/effects';
2
+ export interface MigrationRoute {
3
+ from: Position2D;
4
+ to: Position2D;
5
+ /** 透传到弧线与粒子要素的属性 */
6
+ properties?: Record<string, unknown>;
7
+ }
8
+ /** 迁徙图:OD 对生成贝塞尔弧线,粒子沿线循环飞行 + 渐变尾迹。 */
9
+ type __VLS_Props = {
10
+ /** 起讫点对列表 */
11
+ data: MigrationRoute[];
12
+ /** 图层 id 前缀;省略时自动生成 */
13
+ layerId?: string;
14
+ /**
15
+ * 主色
16
+ * @defaultValue '#f43f5e'
17
+ */
18
+ color?: string;
19
+ /**
20
+ * 弧线弯曲程度
21
+ * @defaultValue 0.3
22
+ */
23
+ curvature?: number;
24
+ /**
25
+ * 单程飞行周期(毫秒)
26
+ * @defaultValue 3000
27
+ */
28
+ duration?: number;
29
+ /**
30
+ * 线宽(像素)
31
+ * @defaultValue 2
32
+ */
33
+ lineWidth?: number;
34
+ /**
35
+ * 粒子半径(像素)
36
+ * @defaultValue 4
37
+ */
38
+ particleRadius?: number;
39
+ /** 插入到该图层之前 */
40
+ beforeId?: string;
41
+ };
42
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
43
+ color: string;
44
+ duration: number;
45
+ curvature: number;
46
+ lineWidth: number;
47
+ particleRadius: number;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
+ declare const _default: typeof __VLS_export;
50
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 雷达:canvas 生成扇形扫描贴图,symbol 图层按帧旋转。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 图层 id 前缀;省略时自动生成 */
7
+ layerId?: string;
8
+ /**
9
+ * 主色
10
+ * @defaultValue '#22c55e'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 扫描半径(像素)
15
+ * @defaultValue 60
16
+ */
17
+ radius?: number;
18
+ /**
19
+ * 旋转速度(度/秒)
20
+ * @defaultValue 120
21
+ */
22
+ speed?: number;
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<{}>, {
27
+ color: string;
28
+ speed: number;
29
+ radius: number;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
@@ -0,0 +1,49 @@
1
+ <script setup>
2
+ import { computed, onUnmounted, useId } from "vue";
3
+ import { radarSweepImage } from "../../utils/effects";
4
+ import { useMap } from "../../composables/useMap";
5
+ import { useMapAnimation } from "../../composables/useMapAnimation";
6
+ import MaplibreSource from "../Source.vue";
7
+ import MaplibreLayer from "../Layer.vue";
8
+ const props = defineProps({
9
+ data: { type: null, required: true },
10
+ layerId: { type: String, required: false },
11
+ color: { type: String, required: false, default: "#22c55e" },
12
+ radius: { type: Number, required: false, default: 60 },
13
+ speed: { type: Number, required: false, default: 120 },
14
+ beforeId: { type: String, required: false }
15
+ });
16
+ const IMAGE_SIZE = 256;
17
+ const ctx = useMap();
18
+ const id = props.layerId ?? `movk-radar-${useId()}`;
19
+ const imageName = `${id}-sweep`;
20
+ const source = computed(() => ({ type: "geojson", data: props.data }));
21
+ const layout = computed(() => ({
22
+ "icon-image": imageName,
23
+ "icon-size": props.radius * 2 / IMAGE_SIZE,
24
+ "icon-allow-overlap": true,
25
+ "icon-ignore-placement": true,
26
+ // 贴图随地图旋转而非屏幕,扫描方位与地理方向一致
27
+ "icon-rotation-alignment": "map"
28
+ }));
29
+ const stopReady = ctx.onReady((map) => {
30
+ if (map.hasImage(imageName)) return;
31
+ const image = radarSweepImage(IMAGE_SIZE, props.color);
32
+ if (image) map.addImage(imageName, image);
33
+ });
34
+ useMapAnimation((map, elapsed) => {
35
+ if (!map.getLayer(id)) return;
36
+ map.setLayoutProperty(id, "icon-rotate", elapsed / 1e3 * props.speed % 360);
37
+ });
38
+ onUnmounted(() => {
39
+ stopReady();
40
+ const map = ctx.map.value;
41
+ if (map?.hasImage(imageName)) map.removeImage(imageName);
42
+ });
43
+ </script>
44
+
45
+ <template>
46
+ <MaplibreSource :source-id="id" :source="source">
47
+ <MaplibreLayer :layer-id="id" type="symbol" :source="id" :layout="layout" :before-id="beforeId" />
48
+ </MaplibreSource>
49
+ </template>
@@ -0,0 +1,32 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 雷达:canvas 生成扇形扫描贴图,symbol 图层按帧旋转。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 图层 id 前缀;省略时自动生成 */
7
+ layerId?: string;
8
+ /**
9
+ * 主色
10
+ * @defaultValue '#22c55e'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 扫描半径(像素)
15
+ * @defaultValue 60
16
+ */
17
+ radius?: number;
18
+ /**
19
+ * 旋转速度(度/秒)
20
+ * @defaultValue 120
21
+ */
22
+ speed?: number;
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<{}>, {
27
+ color: string;
28
+ speed: number;
29
+ radius: number;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;