@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,24 @@
1
+ import { AttributionControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * AttributionControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/AttributionControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof AttributionControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,24 @@
1
+ import { FullscreenControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * FullscreenControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/FullscreenControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof FullscreenControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,18 @@
1
+ <script setup>
2
+ import { omitUndefined } from "@movk/core";
3
+ import { FullscreenControl } from "maplibre-gl";
4
+ import { useControl } from "../../domains/map/control";
5
+ const props = defineProps({
6
+ position: { type: String, required: false },
7
+ options: { type: null, required: false }
8
+ });
9
+ useControl(
10
+ () => new FullscreenControl(omitUndefined(props.options ?? {})),
11
+ () => props.position,
12
+ () => props.options
13
+ );
14
+ </script>
15
+
16
+ <template>
17
+ <slot />
18
+ </template>
@@ -0,0 +1,24 @@
1
+ import { FullscreenControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * FullscreenControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/FullscreenControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof FullscreenControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,24 @@
1
+ import { GeolocateControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * GeolocateControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/GeolocateControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof GeolocateControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,18 @@
1
+ <script setup>
2
+ import { omitUndefined } from "@movk/core";
3
+ import { GeolocateControl } from "maplibre-gl";
4
+ import { useControl } from "../../domains/map/control";
5
+ const props = defineProps({
6
+ position: { type: String, required: false },
7
+ options: { type: null, required: false }
8
+ });
9
+ useControl(
10
+ () => new GeolocateControl(omitUndefined(props.options ?? {})),
11
+ () => props.position,
12
+ () => props.options
13
+ );
14
+ </script>
15
+
16
+ <template>
17
+ <slot />
18
+ </template>
@@ -0,0 +1,24 @@
1
+ import { GeolocateControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * GeolocateControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/GeolocateControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof GeolocateControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,24 @@
1
+ import { NavigationControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * NavigationControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/NavigationControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof NavigationControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,18 @@
1
+ <script setup>
2
+ import { omitUndefined } from "@movk/core";
3
+ import { NavigationControl } from "maplibre-gl";
4
+ import { useControl } from "../../domains/map/control";
5
+ const props = defineProps({
6
+ position: { type: String, required: false },
7
+ options: { type: null, required: false }
8
+ });
9
+ useControl(
10
+ () => new NavigationControl(omitUndefined(props.options ?? {})),
11
+ () => props.position,
12
+ () => props.options
13
+ );
14
+ </script>
15
+
16
+ <template>
17
+ <slot />
18
+ </template>
@@ -0,0 +1,24 @@
1
+ import { NavigationControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * NavigationControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/NavigationControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof NavigationControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,24 @@
1
+ import { ScaleControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * ScaleControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/ScaleControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof ScaleControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,18 @@
1
+ <script setup>
2
+ import { omitUndefined } from "@movk/core";
3
+ import { ScaleControl } from "maplibre-gl";
4
+ import { useControl } from "../../domains/map/control";
5
+ const props = defineProps({
6
+ position: { type: String, required: false },
7
+ options: { type: null, required: false }
8
+ });
9
+ useControl(
10
+ () => new ScaleControl(omitUndefined(props.options ?? {})),
11
+ () => props.position,
12
+ () => props.options
13
+ );
14
+ </script>
15
+
16
+ <template>
17
+ <slot />
18
+ </template>
@@ -0,0 +1,24 @@
1
+ import { ScaleControl } from 'maplibre-gl';
2
+ import type { ControlPosition } from 'maplibre-gl';
3
+ type __VLS_Props = {
4
+ /** 控件停靠位置;省略用地图默认位置 */
5
+ position?: ControlPosition;
6
+ /**
7
+ * ScaleControl 构造选项
8
+ * @see https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/ScaleControlOptions/
9
+ */
10
+ options?: ConstructorParameters<typeof ScaleControl>[0];
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,28 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 动图图标层:ImageDecoder 解码 GIF/APNG/WebP 为帧,按各帧时长驱动 symbol 循环播放,零解码依赖。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 动图 URL(GIF/APNG/WebP/AVIF) */
7
+ image: string;
8
+ /**
9
+ * 图标边长(像素),帧统一缩放到 size×size
10
+ * @defaultValue 64
11
+ */
12
+ size?: number;
13
+ /**
14
+ * 解码无原生帧时长时的回退帧率
15
+ * @defaultValue 12
16
+ */
17
+ fps?: number;
18
+ /** 图层 id;省略时自动生成 */
19
+ layerId?: string;
20
+ /** 插入到该图层之前 */
21
+ beforeId?: string;
22
+ };
23
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
+ size: number;
25
+ fps: number;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,50 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, useId, watch } from "vue";
3
+ import { decodeAnimatedImage } from "../../utils/animated-image";
4
+ import { useMap } from "../../composables/useMap";
5
+ import { useFrameIcon } from "../../composables/useFrameIcon";
6
+ import MaplibreSource from "../Source.vue";
7
+ import MaplibreLayer from "../Layer.vue";
8
+ const props = defineProps({
9
+ data: { type: null, required: true },
10
+ image: { type: String, required: true },
11
+ size: { type: Number, required: false, default: 64 },
12
+ fps: { type: Number, required: false, default: 12 },
13
+ layerId: { type: String, required: false },
14
+ beforeId: { type: String, required: false }
15
+ });
16
+ const ctx = useMap();
17
+ const id = props.layerId ?? `movk-animated-${useId()}`;
18
+ const imageName = `${id}-frames`;
19
+ const source = computed(() => ({ type: "geojson", data: props.data }));
20
+ const layout = computed(() => ({
21
+ "icon-image": imageName,
22
+ "icon-allow-overlap": true,
23
+ "icon-ignore-placement": true
24
+ }));
25
+ const frames = ref([]);
26
+ const durations = ref([]);
27
+ useFrameIcon({
28
+ imageName,
29
+ size: props.size,
30
+ frames: () => frames.value,
31
+ fps: props.fps,
32
+ durations: () => durations.value
33
+ });
34
+ async function load(url) {
35
+ frames.value = [];
36
+ durations.value = [];
37
+ const decoded = await decodeAnimatedImage(url, props.size);
38
+ frames.value = decoded.frames;
39
+ durations.value = decoded.durations;
40
+ ctx.map.value?.triggerRepaint();
41
+ }
42
+ onMounted(() => load(props.image));
43
+ watch(() => props.image, (url) => load(url));
44
+ </script>
45
+
46
+ <template>
47
+ <MaplibreSource :source-id="id" :source="source">
48
+ <MaplibreLayer :layer-id="id" type="symbol" :source="id" :layout="layout" :before-id="beforeId" />
49
+ </MaplibreSource>
50
+ </template>
@@ -0,0 +1,28 @@
1
+ import type { GeoJSONSourceSpecification } from '@maplibre/maplibre-gl-style-spec';
2
+ /** 动图图标层:ImageDecoder 解码 GIF/APNG/WebP 为帧,按各帧时长驱动 symbol 循环播放,零解码依赖。 */
3
+ type __VLS_Props = {
4
+ /** 点要素数据(GeoJSON 或其 URL) */
5
+ data: GeoJSONSourceSpecification['data'];
6
+ /** 动图 URL(GIF/APNG/WebP/AVIF) */
7
+ image: string;
8
+ /**
9
+ * 图标边长(像素),帧统一缩放到 size×size
10
+ * @defaultValue 64
11
+ */
12
+ size?: number;
13
+ /**
14
+ * 解码无原生帧时长时的回退帧率
15
+ * @defaultValue 12
16
+ */
17
+ fps?: number;
18
+ /** 图层 id;省略时自动生成 */
19
+ layerId?: string;
20
+ /** 插入到该图层之前 */
21
+ beforeId?: string;
22
+ };
23
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
+ size: number;
25
+ fps: number;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ 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 '#3b82f6'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 最大扩散半径(像素)
15
+ * @defaultValue 40
16
+ */
17
+ maxRadius?: number;
18
+ /**
19
+ * 单圈扩散周期(毫秒)
20
+ * @defaultValue 2400
21
+ */
22
+ duration?: number;
23
+ /**
24
+ * 同时扩散的圈数
25
+ * @defaultValue 3
26
+ */
27
+ rings?: number;
28
+ /**
29
+ * 峰值不透明度
30
+ * @defaultValue 0.6
31
+ */
32
+ opacity?: 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
+ opacity: number;
39
+ maxRadius: number;
40
+ duration: number;
41
+ rings: number;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ import { computed, useId } from "vue";
3
+ import { ringFade, ringProgress } 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: null, required: true },
9
+ layerId: { type: String, required: false },
10
+ color: { type: String, required: false, default: "#3b82f6" },
11
+ maxRadius: { type: Number, required: false, default: 40 },
12
+ duration: { type: Number, required: false, default: 2400 },
13
+ rings: { type: Number, required: false, default: 3 },
14
+ opacity: { type: Number, required: false, default: 0.6 },
15
+ beforeId: { type: String, required: false }
16
+ });
17
+ const id = props.layerId ?? `movk-diffusion-${useId()}`;
18
+ const source = computed(() => ({ type: "geojson", data: props.data }));
19
+ const initialPaint = computed(() => ({
20
+ "circle-color": props.color,
21
+ "circle-radius": 0,
22
+ "circle-opacity": 0
23
+ }));
24
+ useMapAnimation((map, elapsed) => {
25
+ for (let ring = 0; ring < props.rings; ring++) {
26
+ const layerId = `${id}-ring-${ring}`;
27
+ if (!map.getLayer(layerId)) continue;
28
+ const progress = ringProgress(ring, props.rings, elapsed, props.duration);
29
+ map.setPaintProperty(layerId, "circle-radius", progress * props.maxRadius);
30
+ map.setPaintProperty(layerId, "circle-opacity", ringFade(progress) * props.opacity);
31
+ }
32
+ });
33
+ </script>
34
+
35
+ <template>
36
+ <MaplibreSource :source-id="id" :source="source">
37
+ <MaplibreLayer
38
+ v-for="ring in rings"
39
+ :key="ring"
40
+ :layer-id="`${id}-ring-${ring - 1}`"
41
+ type="circle"
42
+ :source="id"
43
+ :paint="initialPaint"
44
+ :before-id="beforeId"
45
+ />
46
+ </MaplibreSource>
47
+ </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 '#3b82f6'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * 最大扩散半径(像素)
15
+ * @defaultValue 40
16
+ */
17
+ maxRadius?: number;
18
+ /**
19
+ * 单圈扩散周期(毫秒)
20
+ * @defaultValue 2400
21
+ */
22
+ duration?: number;
23
+ /**
24
+ * 同时扩散的圈数
25
+ * @defaultValue 3
26
+ */
27
+ rings?: number;
28
+ /**
29
+ * 峰值不透明度
30
+ * @defaultValue 0.6
31
+ */
32
+ opacity?: 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
+ opacity: number;
39
+ maxRadius: number;
40
+ duration: number;
41
+ rings: number;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
@@ -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;