deeptwins-engine-3d 0.1.31 → 0.1.32

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/dist/esm/index.js CHANGED
@@ -51,7 +51,7 @@ loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
51
51
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
52
52
  _classCallCheck(this, DeepTwinsEngine3D);
53
53
  });
54
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.31");
54
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.32");
55
55
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
56
56
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
57
57
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -61,6 +61,7 @@ export default class Map extends Cesium.Viewer implements MapContext {
61
61
  flyToGraphicLayers(layers: any[], options: any): void;
62
62
  flyToPoints(geoJson: any, options: any): void;
63
63
  addTrafficHistory(TrafficHistoryLayer: any): any;
64
+ addTerrainUrl(url: string): Promise<unknown>;
64
65
  addTerrain(terrain: any): Promise<unknown>;
65
66
  resetTerrain(): void;
66
67
  showModuleLayer(isShow: boolean): void;
@@ -606,15 +606,33 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
606
606
  return new TrafficHistoryLayer(this);
607
607
  }
608
608
 
609
+ // 添加地形url
610
+ }, {
611
+ key: "addTerrainUrl",
612
+ value: function addTerrainUrl(url) {
613
+ var _this5 = this;
614
+ var terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl(url));
615
+ this.scene.setTerrain(terrain);
616
+ return new Promise(function (resolve, reject) {
617
+ terrain.readyEvent.addEventListener(function (provider) {
618
+ _this5.scene.globe.enableLighting = true;
619
+ resolve(provider);
620
+ });
621
+ terrain.errorEvent.addEventListener(function (error) {
622
+ reject(error);
623
+ });
624
+ });
625
+ }
626
+
609
627
  // 添加地形
610
628
  }, {
611
629
  key: "addTerrain",
612
630
  value: function addTerrain(terrain) {
613
- var _this5 = this;
631
+ var _this6 = this;
614
632
  this.scene.setTerrain(terrain);
615
633
  return new Promise(function (resolve, reject) {
616
634
  terrain.readyEvent.addEventListener(function (provider) {
617
- _this5.scene.globe.enableLighting = true;
635
+ _this6.scene.globe.enableLighting = true;
618
636
  resolve(provider);
619
637
  });
620
638
  terrain.errorEvent.addEventListener(function (error) {