| if (options.node && options.obfuscate) { | if (options.node && options.obfuscate) { | ||||
| await gulp | await gulp | ||||
| .src('dist/index.js') | .src('dist/index.js') | ||||
| .pipe(javascriptObfuscator(obfuscatorConfig)) | |||||
| .pipe( | |||||
| javascriptObfuscator({ | |||||
| ...obfuscatorConfig, | |||||
| target: 'browser-no-eval', | |||||
| }) | |||||
| ) | |||||
| .pipe(gulp.dest('dist')) | .pipe(gulp.dest('dist')) | ||||
| .on('end', () => { | .on('end', () => { | ||||
| addCopyright(options) | addCopyright(options) |
| { | { | ||||
| "name": "@dvgis/dc-sdk", | "name": "@dvgis/dc-sdk", | ||||
| "version": "3.3.0", | |||||
| "version": "3.5.0", | |||||
| "license": "MIT", | "license": "MIT", | ||||
| "description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.", | "description": "The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.", | ||||
| "repository": "https://github.com/dvgis/dc-sdk.git", | "repository": "https://github.com/dvgis/dc-sdk.git", | ||||
| ], | ], | ||||
| "author": "Caven Chen <cavencj@gmail.com>", | "author": "Caven Chen <cavencj@gmail.com>", | ||||
| "type": "module", | "type": "module", | ||||
| "main": "dist/index.cjs", | |||||
| "main": "dist/index.js", | |||||
| "scripts": { | "scripts": { | ||||
| "dev": "rimraf dist && gulp dev", | "dev": "rimraf dist && gulp dev", | ||||
| "build": "rimraf dist && gulp build", | "build": "rimraf dist && gulp build", | ||||
| "@babel/plugin-proposal-class-properties": "^7.18.6", | "@babel/plugin-proposal-class-properties": "^7.18.6", | ||||
| "@babel/plugin-transform-runtime": "^7.21.4", | "@babel/plugin-transform-runtime": "^7.21.4", | ||||
| "@babel/preset-env": "^7.21.5", | "@babel/preset-env": "^7.21.5", | ||||
| "@cesium/engine": "^8.0.0", | |||||
| "@cesium/engine": "^9.1.0", | |||||
| "chalk": "^5.2.0", | "chalk": "^5.2.0", | ||||
| "esbuild": "^0.20.1", | "esbuild": "^0.20.1", | ||||
| "esbuild-plugin-glsl": "^1.2.1", | "esbuild-plugin-glsl": "^1.2.1", | ||||
| "dist" | "dist" | ||||
| ], | ], | ||||
| "dependencies": { | "dependencies": { | ||||
| "@dvgis/dc-common": "^1.0.0" | |||||
| "@dvgis/dc-common": "^2.0.0" | |||||
| } | } | ||||
| } | } |
| let _baseUrl = DEF_BASE_URL | let _baseUrl = DEF_BASE_URL | ||||
| let __isInitialized = false | |||||
| export const config = { | export const config = { | ||||
| set baseUrl(baseUrl) { | set baseUrl(baseUrl) { | ||||
| _baseUrl = baseUrl | _baseUrl = baseUrl | ||||
| } | } | ||||
| export function ready(options = {}) { | export function ready(options = {}) { | ||||
| if(__isInitialized){ | |||||
| return Promise.resolve() | |||||
| } | |||||
| __cmdOut && __cmdOut() | __cmdOut && __cmdOut() | ||||
| if (options['baseUrl']) { | if (options['baseUrl']) { | ||||
| this.config.baseUrl = options['baseUrl'] | this.config.baseUrl = options['baseUrl'] | ||||
| } | } | ||||
| this[key] = modules[key] | this[key] = modules[key] | ||||
| }) | }) | ||||
| } | } | ||||
| __isInitialized = true | |||||
| resolve() | resolve() | ||||
| }).catch((e) => { | }).catch((e) => { | ||||
| throw new Error(e.message) | throw new Error(e.message) |
| Matrix4, | Matrix4, | ||||
| Property, | Property, | ||||
| SceneMode, | SceneMode, | ||||
| ScreenSpaceEventType, | |||||
| TimeDynamicPointCloud, | TimeDynamicPointCloud, | ||||
| VoxelPrimitive, | VoxelPrimitive, | ||||
| Color, | Color, | ||||
| * @property {ContextOptions} [contextOptions] Context and WebGL creation properties passed to {@link Scene}. | * @property {ContextOptions} [contextOptions] Context and WebGL creation properties passed to {@link Scene}. | ||||
| * @property {SceneMode} [sceneMode=SceneMode.SCENE3D] The initial scene mode. | * @property {SceneMode} [sceneMode=SceneMode.SCENE3D] The initial scene mode. | ||||
| * @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. | * @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes. | ||||
| * @property {Globe|false} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to <code>false</code>, no globe will be added. | |||||
| * @property {Globe|false} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to <code>false</code>, no globe will be added and the sky atmosphere will be hidden by default. | |||||
| * @property {boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. | * @property {boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency. | ||||
| * @property {Element|string} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. | * @property {Element|string} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. | ||||
| * @property {Element|string} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. | * @property {Element|string} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. | ||||
| let i | let i | ||||
| if ( | |||||
| defined(this.screenSpaceEventHandler) && | |||||
| !this.screenSpaceEventHandler.isDestroyed() | |||||
| ) { | |||||
| this.screenSpaceEventHandler.removeInputAction( | |||||
| ScreenSpaceEventType.LEFT_CLICK | |||||
| ) | |||||
| this.screenSpaceEventHandler.removeInputAction( | |||||
| ScreenSpaceEventType.LEFT_DOUBLE_CLICK | |||||
| ) | |||||
| } | |||||
| // Unsubscribe from data sources | // Unsubscribe from data sources | ||||
| const dataSources = this.dataSources | const dataSources = this.dataSources | ||||
| const dataSourceLength = dataSources.length | const dataSourceLength = dataSources.length |