diff --git a/gulpfile.js b/gulpfile.js index 7e0a6867..0e4c2c58 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -46,6 +46,7 @@ const buildConfig = { sourcemap: false, write: true, logLevel: 'info', + external: [`http`, `https`, `url`, `zlib`], plugins: [ inlineImage({ limit: -1, @@ -67,7 +68,7 @@ function getTime() { async function buildNamespace(options) { const bundle = await rollup({ - input: 'src/namespace/libs.js', + input: 'libs/index.js', plugins: [ commonjs(), resolve({ preferBuiltins: true }), diff --git a/src/namespace/libs.js b/libs/index.js similarity index 100% rename from src/namespace/libs.js rename to libs/index.js diff --git a/src/index.js b/src/index.js index 7c1d06a1..394f4e60 100644 --- a/src/index.js +++ b/src/index.js @@ -37,9 +37,9 @@ export function ready(options = {}) { registerLib('Cesium', this['__namespace']['Cesium']) } - // if (options['echarts']) { - // registerLib('echarts', options['echarts']) - // } + if (options['echarts']) { + registerLib('echarts', options['echarts']) + } // if (options['turf']) { // registerLib('turf', options['turf']) diff --git a/src/modules/exts/BaseLayerPicker.js b/src/modules/exts/BaseLayerPicker.js index e6f0df9d..1ea404ee 100644 --- a/src/modules/exts/BaseLayerPicker.js +++ b/src/modules/exts/BaseLayerPicker.js @@ -2,7 +2,7 @@ @Author: Caven Chen **/ -import { Cesium } from '../../namespace/index.js' +import { Cesium } from '../../namespace' const { EllipsoidTerrainProvider } = Cesium diff --git a/src/modules/exts/Viewer.js b/src/modules/exts/Viewer.js index 9cbc6340..a50e67bb 100644 --- a/src/modules/exts/Viewer.js +++ b/src/modules/exts/Viewer.js @@ -2,7 +2,7 @@ @author : Caven Chen @date : 2023-05-23 */ -import { Cesium } from '../../namespace/index.js' +import { Cesium } from '../../namespace' const { BoundingSphere, diff --git a/src/modules/layer/type/FeatureGridLayer.js b/src/modules/layer/type/FeatureGridLayer.js index 54b6cd1f..4f139884 100644 --- a/src/modules/layer/type/FeatureGridLayer.js +++ b/src/modules/layer/type/FeatureGridLayer.js @@ -189,7 +189,7 @@ class FeatureGridLayer extends Layer { }).then((res) => { let dataList = res if (this._options.dataProperty) { - dataList = eval('res.' + this._options.dataProperty) + dataList = res[this._options.dataProperty] } if (dataList && dataList.length) { for (let i = level + 3; i < this._maximumLevel; i++) { diff --git a/src/modules/viewer/Viewer.js b/src/modules/viewer/Viewer.js index 2216e546..bfbab7e5 100644 --- a/src/modules/viewer/Viewer.js +++ b/src/modules/viewer/Viewer.js @@ -3,7 +3,7 @@ * @Date: 2019-12-27 17:13:24 */ -import { Cesium } from '../../namespace/libs.js' +import { Cesium } from '../../namespace' import Parse from '../parse/Parse' import { LayerGroupEventType,