@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,30 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
|
|
3
|
+
interface MaplibreResolverOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 组件前缀
|
|
6
|
+
* @defaultValue 'Maplibre'
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
interface MaplibreUnpluginOptions extends MaplibreResolverOptions {
|
|
11
|
+
/** 是否生成 components.d.ts / auto-imports.d.ts,默认 true */
|
|
12
|
+
dts?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Maplibre* 组件解析器,注入既有 unplugin-vue-components 实例(如 @nuxt/ui 的单实例)复用 */
|
|
15
|
+
declare function maplibreComponentResolver(options?: MaplibreResolverOptions): {
|
|
16
|
+
type: "component";
|
|
17
|
+
resolve: (name: string) => {
|
|
18
|
+
name: string;
|
|
19
|
+
from: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
};
|
|
22
|
+
/** 本库 composables + 工具的自动导入项,注入既有 unplugin-auto-import 实例复用 */
|
|
23
|
+
declare function maplibreAutoImports(): {
|
|
24
|
+
from: string;
|
|
25
|
+
imports: string[];
|
|
26
|
+
}[];
|
|
27
|
+
declare const MaplibreUnplugin: unplugin.UnpluginInstance<MaplibreUnpluginOptions | undefined, boolean>;
|
|
28
|
+
|
|
29
|
+
export { MaplibreUnplugin, maplibreAutoImports, maplibreComponentResolver };
|
|
30
|
+
export type { MaplibreResolverOptions, MaplibreUnpluginOptions };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
|
|
3
|
+
interface MaplibreResolverOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 组件前缀
|
|
6
|
+
* @defaultValue 'Maplibre'
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
interface MaplibreUnpluginOptions extends MaplibreResolverOptions {
|
|
11
|
+
/** 是否生成 components.d.ts / auto-imports.d.ts,默认 true */
|
|
12
|
+
dts?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Maplibre* 组件解析器,注入既有 unplugin-vue-components 实例(如 @nuxt/ui 的单实例)复用 */
|
|
15
|
+
declare function maplibreComponentResolver(options?: MaplibreResolverOptions): {
|
|
16
|
+
type: "component";
|
|
17
|
+
resolve: (name: string) => {
|
|
18
|
+
name: string;
|
|
19
|
+
from: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
};
|
|
22
|
+
/** 本库 composables + 工具的自动导入项,注入既有 unplugin-auto-import 实例复用 */
|
|
23
|
+
declare function maplibreAutoImports(): {
|
|
24
|
+
from: string;
|
|
25
|
+
imports: string[];
|
|
26
|
+
}[];
|
|
27
|
+
declare const MaplibreUnplugin: unplugin.UnpluginInstance<MaplibreUnpluginOptions | undefined, boolean>;
|
|
28
|
+
|
|
29
|
+
export { MaplibreUnplugin, maplibreAutoImports, maplibreComponentResolver };
|
|
30
|
+
export type { MaplibreResolverOptions, MaplibreUnpluginOptions };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { readdirSync } from 'node:fs';
|
|
2
|
+
import { join, sep } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { createUnplugin } from 'unplugin';
|
|
5
|
+
import Components from 'unplugin-vue-components';
|
|
6
|
+
import AutoImport from 'unplugin-auto-import';
|
|
7
|
+
|
|
8
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
9
|
+
const UTIL_MANIFEST = {
|
|
10
|
+
movkDrawModes: "draw-modes",
|
|
11
|
+
drawThemeStyles: "utils/draw-theme"
|
|
12
|
+
};
|
|
13
|
+
function componentMap() {
|
|
14
|
+
const dir = join(runtimeDir, "components");
|
|
15
|
+
const map = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const file of readdirSync(dir, { recursive: true })) {
|
|
17
|
+
if (!file.endsWith(".vue")) continue;
|
|
18
|
+
map.set(file.slice(file.lastIndexOf(sep) + 1, -".vue".length), join(dir, file));
|
|
19
|
+
}
|
|
20
|
+
return map;
|
|
21
|
+
}
|
|
22
|
+
function maplibreComponentResolver(options = {}) {
|
|
23
|
+
const prefix = options.prefix ?? "Maplibre";
|
|
24
|
+
const map = componentMap();
|
|
25
|
+
return {
|
|
26
|
+
type: "component",
|
|
27
|
+
resolve: (name) => {
|
|
28
|
+
if (!name.startsWith(prefix)) return;
|
|
29
|
+
const from = map.get(name.slice(prefix.length));
|
|
30
|
+
return from ? { name: "default", from } : void 0;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function maplibreAutoImports() {
|
|
35
|
+
const cdir = join(runtimeDir, "composables");
|
|
36
|
+
const composables = readdirSync(cdir).filter((f) => f.endsWith(".ts")).map((f) => f.slice(0, -".ts".length)).map((name) => ({ from: join(cdir, name), imports: [name] }));
|
|
37
|
+
const utils = Object.entries(UTIL_MANIFEST).map(([name, file]) => ({ from: join(runtimeDir, file), imports: [name] }));
|
|
38
|
+
return [...composables, ...utils];
|
|
39
|
+
}
|
|
40
|
+
const MaplibreUnplugin = createUnplugin((options = {}, meta) => {
|
|
41
|
+
const dts = options.dts ?? true;
|
|
42
|
+
const components = Components.raw({
|
|
43
|
+
dts,
|
|
44
|
+
resolvers: [maplibreComponentResolver(options)]
|
|
45
|
+
}, meta);
|
|
46
|
+
const autoImport = AutoImport.raw({
|
|
47
|
+
dts,
|
|
48
|
+
imports: maplibreAutoImports()
|
|
49
|
+
}, meta);
|
|
50
|
+
return [components, autoImport].flat();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export { MaplibreUnplugin, maplibreAutoImports, maplibreComponentResolver };
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { MaplibreUnpluginOptions } from './unplugin.mjs';
|
|
3
|
+
export { MaplibreResolverOptions } from './unplugin.mjs';
|
|
4
|
+
|
|
5
|
+
declare const _default: (options?: MaplibreUnpluginOptions | undefined) => unplugin.VitePlugin<any> | unplugin.VitePlugin<any>[];
|
|
6
|
+
|
|
7
|
+
export { MaplibreUnpluginOptions, _default as default };
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { MaplibreUnpluginOptions } from './unplugin.js';
|
|
3
|
+
export { MaplibreResolverOptions } from './unplugin.js';
|
|
4
|
+
|
|
5
|
+
declare const _default: (options?: MaplibreUnpluginOptions | undefined) => unplugin.VitePlugin<any> | unplugin.VitePlugin<any>[];
|
|
6
|
+
|
|
7
|
+
export { MaplibreUnpluginOptions, _default as default };
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaplibreUnplugin } from './unplugin.mjs';
|
|
2
|
+
import 'node:fs';
|
|
3
|
+
import 'node:path';
|
|
4
|
+
import 'node:url';
|
|
5
|
+
import 'unplugin';
|
|
6
|
+
import 'unplugin-vue-components';
|
|
7
|
+
import 'unplugin-auto-import';
|
|
8
|
+
|
|
9
|
+
const vite = MaplibreUnplugin.vite;
|
|
10
|
+
|
|
11
|
+
export { vite as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { MaplibreRuntimeConfig } from '../dist/runtime/types/index.js';
|
|
3
|
+
export * from '../dist/runtime/types/index.js';
|
|
4
|
+
|
|
5
|
+
type MaplibreVuePluginOptions = Partial<MaplibreRuntimeConfig>;
|
|
6
|
+
declare const MaplibrePlugin: Plugin<MaplibreVuePluginOptions>;
|
|
7
|
+
|
|
8
|
+
export { MaplibrePlugin, MaplibrePlugin as default };
|
|
9
|
+
export type { MaplibreVuePluginOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { MaplibreRuntimeConfig } from '../dist/runtime/types/index.js';
|
|
3
|
+
export * from '../dist/runtime/types/index.js';
|
|
4
|
+
|
|
5
|
+
type MaplibreVuePluginOptions = Partial<MaplibreRuntimeConfig>;
|
|
6
|
+
declare const MaplibrePlugin: Plugin<MaplibreVuePluginOptions>;
|
|
7
|
+
|
|
8
|
+
export { MaplibrePlugin, MaplibrePlugin as default };
|
|
9
|
+
export type { MaplibreVuePluginOptions };
|
package/package.json
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@movk/maplibre",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"packageManager": "pnpm@12.5.1",
|
|
6
|
+
"description": "声明式 MapLibre GL 封装库:MaplibreMap/Source/Layer 等组件与 composables,原生支持 Nuxt 4 模块,并通过 Vite 插件在纯 Vue + Vite 项目中可用。无需 access token,内置 3D 建筑、雷达/扩散/辉光等动态效果,sky/terrain 环境,绘制(terra-draw)、天地图、WMS/WMTS 与多坐标系本土化支持。",
|
|
7
|
+
"author": "YiXuan <mhaibaraai@gmail.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/mhaibaraai/movk-maplibre.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://maplibre.mhaibaraai.cn",
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/mhaibaraai/movk-maplibre/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"nuxt",
|
|
22
|
+
"nuxt-module",
|
|
23
|
+
"nuxt4",
|
|
24
|
+
"vue",
|
|
25
|
+
"vite",
|
|
26
|
+
"maplibre",
|
|
27
|
+
"maplibre-gl",
|
|
28
|
+
"map",
|
|
29
|
+
"gis",
|
|
30
|
+
"tianditu",
|
|
31
|
+
"terra-draw",
|
|
32
|
+
"composables"
|
|
33
|
+
],
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/module.d.mts",
|
|
37
|
+
"style": "./dist/runtime/index.css",
|
|
38
|
+
"import": "./dist/module.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./vite": {
|
|
41
|
+
"types": "./dist/vite.d.mts",
|
|
42
|
+
"import": "./dist/vite.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./unplugin": {
|
|
45
|
+
"types": "./dist/unplugin.d.mts",
|
|
46
|
+
"import": "./dist/unplugin.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./vue-plugin": {
|
|
49
|
+
"types": "./dist/vue-plugin.d.mts",
|
|
50
|
+
"import": "./dist/vue-plugin.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./draw-modes": {
|
|
53
|
+
"types": "./dist/runtime/draw-modes/index.d.ts",
|
|
54
|
+
"import": "./dist/runtime/draw-modes/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./index.css": "./dist/runtime/index.css",
|
|
57
|
+
"./runtime/*": "./dist/runtime/*",
|
|
58
|
+
"./components/*": "./dist/runtime/components/*",
|
|
59
|
+
"./utils/*": {
|
|
60
|
+
"types": "./dist/runtime/utils/*.d.ts",
|
|
61
|
+
"import": "./dist/runtime/utils/*.js"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"typesVersions": {
|
|
65
|
+
"*": {
|
|
66
|
+
".": [
|
|
67
|
+
"./dist/module.d.mts"
|
|
68
|
+
],
|
|
69
|
+
"vite": [
|
|
70
|
+
"./dist/vite.d.mts"
|
|
71
|
+
],
|
|
72
|
+
"unplugin": [
|
|
73
|
+
"./dist/unplugin.d.mts"
|
|
74
|
+
],
|
|
75
|
+
"vue-plugin": [
|
|
76
|
+
"./dist/vue-plugin.d.mts"
|
|
77
|
+
],
|
|
78
|
+
"draw-modes": [
|
|
79
|
+
"./dist/runtime/draw-modes/index.d.ts"
|
|
80
|
+
],
|
|
81
|
+
"runtime/*": [
|
|
82
|
+
"./dist/runtime/*"
|
|
83
|
+
],
|
|
84
|
+
"components/*": [
|
|
85
|
+
"./dist/runtime/components/*"
|
|
86
|
+
],
|
|
87
|
+
"utils/*": [
|
|
88
|
+
"./dist/runtime/utils/*.d.ts"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"style": "./dist/runtime/index.css",
|
|
93
|
+
"main": "./dist/module.mjs",
|
|
94
|
+
"files": [
|
|
95
|
+
"dist"
|
|
96
|
+
],
|
|
97
|
+
"peerDependencies": {
|
|
98
|
+
"lottie-web": ">=5.0.0",
|
|
99
|
+
"maplibre-gl": ">=6.0.0",
|
|
100
|
+
"terra-draw": ">=1.0.0",
|
|
101
|
+
"terra-draw-maplibre-gl-adapter": ">=1.0.0",
|
|
102
|
+
"vue": ">=3.5.0"
|
|
103
|
+
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"lottie-web": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"terra-draw": {
|
|
109
|
+
"optional": true
|
|
110
|
+
},
|
|
111
|
+
"terra-draw-maplibre-gl-adapter": {
|
|
112
|
+
"optional": true
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"scripts": {
|
|
116
|
+
"prepack": "pnpm build",
|
|
117
|
+
"build": "nuxt-module-build build",
|
|
118
|
+
"dev": "nuxt dev playgrounds/play",
|
|
119
|
+
"dev:build": "nuxt build playgrounds/play",
|
|
120
|
+
"dev:vue": "pnpm --filter './playgrounds/vue' dev",
|
|
121
|
+
"dev:vue:build": "pnpm --filter './playgrounds/vue' build",
|
|
122
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playgrounds/play && nuxt prepare docs && pnpm dev:vue:build",
|
|
123
|
+
"docs": "nuxt dev docs",
|
|
124
|
+
"docs:build": "nuxt build docs",
|
|
125
|
+
"release": "release-it",
|
|
126
|
+
"lint": "eslint .",
|
|
127
|
+
"lint:fix": "eslint . --fix",
|
|
128
|
+
"clean": "movk-clean",
|
|
129
|
+
"typecheck": "vue-tsc --noEmit && nuxt typecheck playgrounds/play && nuxt typecheck docs && cd playgrounds/vue && vue-tsc --noEmit",
|
|
130
|
+
"test": "vitest"
|
|
131
|
+
},
|
|
132
|
+
"dependencies": {
|
|
133
|
+
"@maplibre/maplibre-gl-style-spec": "^26.4.4",
|
|
134
|
+
"@movk/core": "^1.4.1",
|
|
135
|
+
"@turf/area": "^7.4.0",
|
|
136
|
+
"@turf/bearing": "^7.4.0",
|
|
137
|
+
"@turf/buffer": "^7.4.0",
|
|
138
|
+
"@turf/circle": "^7.4.0",
|
|
139
|
+
"@turf/distance": "^7.4.0",
|
|
140
|
+
"@turf/ellipse": "^7.4.0",
|
|
141
|
+
"@turf/length": "^7.4.0",
|
|
142
|
+
"@turf/sector": "^7.4.0",
|
|
143
|
+
"@vueuse/core": "^15.0.0",
|
|
144
|
+
"consola": "^3.4.2",
|
|
145
|
+
"defu": "^6.1.7",
|
|
146
|
+
"gcoord": "^1.0.7",
|
|
147
|
+
"unplugin-auto-import": "^21.1.0",
|
|
148
|
+
"unplugin-vue-components": "^32.1.0"
|
|
149
|
+
},
|
|
150
|
+
"devDependencies": {
|
|
151
|
+
"@nuxt/eslint-config": "^1.17.0",
|
|
152
|
+
"@nuxt/kit": "^4.5.2",
|
|
153
|
+
"@nuxt/module-builder": "^1.0.3",
|
|
154
|
+
"@nuxt/schema": "^4.5.2",
|
|
155
|
+
"@release-it/conventional-changelog": "^12.0.2",
|
|
156
|
+
"@types/geojson": "^7946.0.16",
|
|
157
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
158
|
+
"@vue/test-utils": "^2.5.1",
|
|
159
|
+
"eslint": "^10.11.0",
|
|
160
|
+
"happy-dom": "^20.14.5",
|
|
161
|
+
"lottie-web": "^5.13.0",
|
|
162
|
+
"maplibre-gl": "^6.10.0",
|
|
163
|
+
"nuxt": "^4.5.2",
|
|
164
|
+
"release-it": "^21.1.0",
|
|
165
|
+
"terra-draw": "^1.35.0",
|
|
166
|
+
"terra-draw-maplibre-gl-adapter": "^1.4.1",
|
|
167
|
+
"typescript": "^6.0.3",
|
|
168
|
+
"unbuild": "^3.6.1",
|
|
169
|
+
"unplugin": "^3.4.0",
|
|
170
|
+
"vitest": "^5.0.1",
|
|
171
|
+
"vue": "^3.5.43",
|
|
172
|
+
"vue-tsc": "^3.3.11"
|
|
173
|
+
}
|
|
174
|
+
}
|