Skip to content

Commit

Permalink
upgrade cesium
Browse files Browse the repository at this point in the history
  • Loading branch information
cavencj committed May 7, 2024
1 parent fd858ff commit a9088aa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
7 changes: 6 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ async function combineJs(options) {
if (options.node && options.obfuscate) {
await gulp
.src('dist/index.js')
.pipe(javascriptObfuscator(obfuscatorConfig))
.pipe(
javascriptObfuscator({
...obfuscatorConfig,
target: 'browser-no-eval',
})
)
.pipe(gulp.dest('dist'))
.on('end', () => {
addCopyright(options)
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dvgis/dc-sdk",
"version": "3.3.0",
"version": "3.5.0",
"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.",
"repository": "https://github.com/dvgis/dc-sdk.git",
Expand All @@ -16,7 +16,7 @@
],
"author": "Caven Chen <[email protected]>",
"type": "module",
"main": "dist/index.cjs",
"main": "dist/index.js",
"scripts": {
"dev": "rimraf dist && gulp dev",
"build": "rimraf dist && gulp build",
Expand All @@ -35,7 +35,7 @@
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.5",
"@cesium/engine": "^8.0.0",
"@cesium/engine": "^9.1.0",
"chalk": "^5.2.0",
"esbuild": "^0.20.1",
"esbuild-plugin-glsl": "^1.2.1",
Expand Down Expand Up @@ -67,6 +67,6 @@
"dist"
],
"dependencies": {
"@dvgis/dc-common": "^1.0.0"
"@dvgis/dc-common": "^2.0.0"
}
}
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const DEF_BASE_URL = './libs/dc-sdk/resources/'

let _baseUrl = DEF_BASE_URL

let __isInitialized = false

export const config = {
set baseUrl(baseUrl) {
_baseUrl = baseUrl
Expand All @@ -19,8 +21,10 @@ export const config = {
}

export function ready(options = {}) {
if(__isInitialized){
return Promise.resolve()
}
__cmdOut && __cmdOut()

if (options['baseUrl']) {
this.config.baseUrl = options['baseUrl']
}
Expand Down Expand Up @@ -75,6 +79,7 @@ export function ready(options = {}) {
this[key] = modules[key]
})
}
__isInitialized = true
resolve()
}).catch((e) => {
throw new Error(e.message)
Expand Down
15 changes: 14 additions & 1 deletion src/modules/exts/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
Matrix4,
Property,
SceneMode,
ScreenSpaceEventType,
TimeDynamicPointCloud,
VoxelPrimitive,
Color,
Expand Down Expand Up @@ -63,7 +64,7 @@ function trackDataSourceClock(timeline, clock, dataSource) {
* @property {ContextOptions} [contextOptions] Context and WebGL creation properties passed to {@link Scene}.
* @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 {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 {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.
Expand Down Expand Up @@ -794,6 +795,18 @@ Viewer.prototype.destroy = function () {

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
const dataSources = this.dataSources
const dataSourceLength = dataSources.length
Expand Down

0 comments on commit a9088aa

Please sign in to comment.