@uavs/3d-model-map 0.1.0 → 0.1.1
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/README.md +13 -30
- package/dist/index.js +609 -598
- package/dist/types/components/RealModelClarityDialog.vue.d.ts +2 -2
- package/dist/types/runtime/cesiumRuntime.d.ts.map +1 -1
- package/dist/types/vite/cesium.d.ts +1 -1
- package/dist/types/vite/cesium.d.ts.map +1 -1
- package/dist/vite/cesium.js +22 -9
- package/package.json +6 -6
|
@@ -9,13 +9,13 @@ type __VLS_Props = {
|
|
|
9
9
|
recommended?: number;
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
reset: () => any;
|
|
12
13
|
"update:modelValue": (value: boolean) => any;
|
|
13
14
|
apply: (value: number) => any;
|
|
14
|
-
reset: () => any;
|
|
15
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onReset?: (() => any) | undefined;
|
|
16
17
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
17
18
|
onApply?: ((value: number) => any) | undefined;
|
|
18
|
-
onReset?: (() => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
actualSse: string;
|
|
21
21
|
modelName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cesiumRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/cesiumRuntime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cesiumRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/cesiumRuntime.ts"],"names":[],"mappings":"AAsEA,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQlD;AAED,wBAAgB,SAAS,IAAI,GAAG,CAE/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Plugin } from 'vite';
|
|
2
|
-
export declare function createCesiumStaticPlugins(cesiumSource
|
|
2
|
+
export declare function createCesiumStaticPlugins(cesiumSource?: string): Plugin[];
|
|
3
3
|
export declare function resolveMapdataProxyTarget(env: Record<string, string | undefined>): string | undefined;
|
|
4
4
|
export declare function createMapdataProxy(env: Record<string, string | undefined>): {
|
|
5
5
|
'/mapdata-map'?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cesium.d.ts","sourceRoot":"","sources":["../../../vite/cesium.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cesium.d.ts","sourceRoot":"","sources":["../../../vite/cesium.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAkHjD,wBAAgB,yBAAyB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBzE;AA6BD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAErG;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;;;;;;;;;EAuBzE"}
|
package/dist/vite/cesium.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createReadStream, existsSync, statSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
2
3
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { extname, join, normalize, relative } from 'node:path';
|
|
4
|
+
import { dirname, extname, join, normalize, relative } from 'node:path';
|
|
4
5
|
import { normalizePath } from 'vite';
|
|
5
6
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
6
8
|
const cesiumPublicPrefix = '/lib/Cesium/';
|
|
7
9
|
const mapPublicRootCandidates = [
|
|
8
10
|
fileURLToPath(new URL('../public', import.meta.url)),
|
|
@@ -86,23 +88,34 @@ function createMapPublicAssetsDevServerPlugin(publicRoot) {
|
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
}
|
|
91
|
+
function resolveCesiumSource(cesiumSource) {
|
|
92
|
+
if (cesiumSource)
|
|
93
|
+
return cesiumSource;
|
|
94
|
+
try {
|
|
95
|
+
return dirname(require.resolve('mars3d-cesium/Build/Cesium/Cesium.js'));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
throw new Error(`Cesium static assets not found from dependency mars3d-cesium. Run pnpm add @uavs/3d-model-map again. ${error instanceof Error ? error.message : String(error)}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
89
101
|
export function createCesiumStaticPlugins(cesiumSource) {
|
|
90
|
-
|
|
91
|
-
|
|
102
|
+
const resolvedCesiumSource = resolveCesiumSource(cesiumSource);
|
|
103
|
+
if (!existsSync(join(resolvedCesiumSource, 'Cesium.js'))) {
|
|
104
|
+
throw new Error(`Cesium static assets not found. Run pnpm install and check: ${resolvedCesiumSource}`);
|
|
92
105
|
}
|
|
93
106
|
const staticCopyPlugins = viteStaticCopy({
|
|
94
107
|
targets: [
|
|
95
|
-
{ src: `${
|
|
96
|
-
{ src: `${
|
|
97
|
-
{ src: `${
|
|
98
|
-
{ src: `${
|
|
99
|
-
{ src: `${
|
|
108
|
+
{ src: `${resolvedCesiumSource}/ThirdParty`, dest: 'lib/Cesium' },
|
|
109
|
+
{ src: `${resolvedCesiumSource}/Workers`, dest: 'lib/Cesium' },
|
|
110
|
+
{ src: `${resolvedCesiumSource}/Assets`, dest: 'lib/Cesium' },
|
|
111
|
+
{ src: `${resolvedCesiumSource}/Widgets`, dest: 'lib/Cesium' },
|
|
112
|
+
{ src: `${resolvedCesiumSource}/Cesium.js`, dest: 'lib/Cesium' },
|
|
100
113
|
{ src: `${normalizedMapPublicRoot}/img/basemaps/*`, dest: 'img/basemaps' }
|
|
101
114
|
],
|
|
102
115
|
silent: true
|
|
103
116
|
});
|
|
104
117
|
return [
|
|
105
|
-
createCesiumDevServerPlugin(
|
|
118
|
+
createCesiumDevServerPlugin(resolvedCesiumSource),
|
|
106
119
|
createMapPublicAssetsDevServerPlugin(mapPublicRoot),
|
|
107
120
|
...(Array.isArray(staticCopyPlugins) ? staticCopyPlugins : [staticCopyPlugins])
|
|
108
121
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uavs/3d-model-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UAVS 3D map components based on Vue 3, Mars3D and Cesium.",
|
|
6
6
|
"type": "module",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"vite-plugin-static-copy": "2.3.2"
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
43
|
"@turf/turf": "^7.3.5",
|
|
47
44
|
"mars3d": "3.11.2",
|
|
48
45
|
"mars3d-cesium": "1.140.0",
|
|
49
|
-
"vite": "
|
|
50
|
-
|
|
46
|
+
"vite-plugin-static-copy": "2.3.2"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"vite": ">=5.0.0 <7.0.0",
|
|
50
|
+
"vue": ">=3.4.0 <4.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"vite": {
|