@gmgis/gm-sdk 1.12.1 → 1.12.2

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 CHANGED
@@ -1,21 +1,3 @@
1
- # GM-SDK 【git更新时间:2024.08.09】
2
-
3
- ### 1.0.3 版本为移动端dpi单独配置,MouseEvent.js
4
-
5
- ### 1.8.1 增加了通过设置id,获取底图方法
6
-
7
- ### 1.8.2 GM.Plane 面加载bug修复
8
-
9
- ### 1.10.1 【git更新时间:2024.10.25】
10
-
11
- ### 1.11.1 增加场景分析,等高线效果,白模震动效果
12
-
13
- ### 1.11.2 增加Turf计算,shp数据图层加载
14
-
15
- ### 1.12.1 Turf计算,应用Module包异常处理
16
-
17
- `DPI` const dpiScale = 1 // 移动端不处理
18
-
19
1
  <p>
20
2
  <img src="https://img.shields.io/github/actions/workflow/status/dvgis/gm-sdk/build.yml"/>
21
3
  <img src="https://img.shields.io/badge/license-Apache%202-blue"/>
package/dist/gm.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * @github http://gitlab.greatmap.com.cn:10000/gmgis/gm-sdk.git
5
5
  * @author XIN <1130779739@qq.com>
6
6
  * @organization dvgis
7
- * @version 1.12.1
7
+ * @version 1.12.2
8
8
  *
9
9
  * Copyright (c) 2019-present Caven Chen
10
10
  *
@@ -17516,5 +17516,5 @@ void main(){
17516
17516
  `}_init(e,t={}){this._enable=!0,this._maxDistance=t.maxDistance||5,this._speed=t.speed||1e3,this._maxHeight=t.maxHeight||20,e&&(this._layer=e,this.tileset_arr=this._layer.delegate._primitives.map(r=>({overlayId:r.overlayId,tileset2:r,tileset:this._layer._cache[r.overlayId]||null})),this.tileset_arr.forEach(r=>{let s=this._getShader(r.tileset2);r.tileset.setCustomShader(s)}))}deactivate(){this._enable=!1,!(!this.tileset_arr||this.tileset_arr.length===0)&&this.tileset_arr.forEach(e=>{let t=new window.GM.CustomShader;e.tileset.setCustomShader(t)})}},kd=sl;var ol=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.Cesium.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.Cesium.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=p.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(a=>i.Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.Cesium.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.Cesium.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let a=o.map(l=>i.Cesium.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.Cesium.sampleTerrainMostDetailed(s,a).then(l=>{let h=l.map(c=>{let d=i.Cesium.Math.toDegrees(c.longitude),f=i.Cesium.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:f,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),a={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0}),typeof this._callback=="function"&&this._callback(a)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cesium.Cartesian3.fromDegreesArray(t),material:new i.Cesium.ImageMaterialProperty({image:this._image,repeat:new i.Cesium.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.Cesium.PolygonHierarchy(i.Cesium.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.Cesium.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cesium.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Cesium.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cesium.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cesium.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Cesium.Math.lerp(o.longitude,a.longitude,l/r),c=i.Cesium.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Cesium.Math.toDegrees(h),lat:i.Cesium.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(a=>i.Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.Cesium.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Fd=ol;function ne(n,e){this.viewer=n,this.options=e||{},this._positions=[new i.Cesium.Cartesian3(-1.1825928630924462e6,5.5155809806405855e6,2966674365247578e-9),new i.Cesium.Cartesian3(-1183337777477057e-9,5515825617716778e-9,2.9659274345367434e6),new i.Cesium.Cartesian3(-1.1845084932830015e6,5515571328839522e-9,2965932974956288e-9),new i.Cesium.Cartesian3(-1.1855870332886775e6,5514889448799464e-9,2.9667642948399023e6),new i.Cesium.Cartesian3(-1.1850990292063756e6,5514576687407264e-9,2967535347584739e-9),new i.Cesium.Cartesian3(-1.1828409384216308e6,551522464431188e-8,2.9672341119776894e6)],this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=i.Cesium.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions)}Object.defineProperties(ne.prototype,{show:{get:function(){return this._show},set:function(n){this._show=n,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=n),this._switchExcavate(n)}},height:{get:function(){return this._height},set:function(n){this._height=n,this._updateExcavateDepth(n)}}});ne.prototype.updateData=function(n){this.clear();var e=[],t=n.length,r=new i.Cesium.Cartesian3,s=i.Cesium.Cartesian3.subtract(n[0],n[1],r);s=s.x>0,this.excavateMinHeight=9999;for(var o=0;o<t;++o){var a=(o+1)%t,l=i.Cesium.Cartographic.fromCartesian(n[o]),h=viewer.scene.globe.getHeight(l)||l.height;h<this.excavateMinHeight&&(this.excavateMinHeight=h);var c=i.Cesium.Cartesian3.add(n[o],n[a],new i.Cesium.Cartesian3);c=i.Cesium.Cartesian3.multiplyByScalar(c,.5,c);var d=i.Cesium.Cartesian3.normalize(c,new i.Cesium.Cartesian3),f=i.Cesium.Cartesian3.subtract(n[a],c,new i.Cesium.Cartesian3);f=i.Cesium.Cartesian3.normalize(f,f);var T=i.Cesium.Cartesian3.cross(f,d,new i.Cesium.Cartesian3);T=i.Cesium.Cartesian3.normalize(T,T);var y=new i.Cesium.Plane(T,0),m=i.Cesium.Plane.getPointDistance(y,c);e.push(new i.Cesium.ClippingPlane(T,m))}this.viewer.scene.globe.clippingPlanes=new i.Cesium.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:i.Cesium.Color.WHITE,enabled:!0}),this._prepareWell(n),this._createWell(this.wellData)};ne.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()};ne.prototype._prepareWell=function(n){var e=this.splitNum,t=n.length;if(t!=0){for(var r=this.excavateMinHeight-this.height,s=[],o=[],a=[],l=0;l<t;l++){var h=l==t-1?0:l+1,c=i.Cesium.Cartographic.fromCartesian(n[l]),d=i.Cesium.Cartographic.fromCartesian(n[h]),f=[c.longitude,c.latitude],T=[d.longitude,d.latitude];l==0&&(a.push(new i.Cesium.Cartographic(f[0],f[1])),o.push(i.Cesium.Cartesian3.fromRadians(f[0],f[1],r)),s.push(i.Cesium.Cartesian3.fromRadians(f[0],f[1],0)));for(var y=1;y<=e;y++){var m=i.Cesium.Math.lerp(f[0],T[0],y/e),E=i.Cesium.Math.lerp(f[1],T[1],y/e);l==t-1&&y==e||(a.push(new i.Cesium.Cartographic(m,E)),o.push(i.Cesium.Cartesian3.fromRadians(m,E,r)),s.push(i.Cesium.Cartesian3.fromRadians(m,E,0)))}}this.wellData={lerp_pos:a,bottom_pos:o,no_height_top:s}}};ne.prototype._createWell=function(n){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(n.bottom_pos);var t=i.Cesium.sampleTerrainMostDetailed(this.viewer.terrainProvider,n.lerp_pos);i.Cesium.when(t,function(r){for(var s=r.length,o=[],a=0;a<s;a++){var l=i.Cesium.Cartesian3.fromRadians(r[a].longitude,r[a].latitude,r[a].height);o.push(l)}e._createWellWall(n.bottom_pos,o)})}else this._createBottomSurface(n.bottom_pos),this._createWellWall(n.bottom_pos,n.no_height_top)};ne.prototype._getMinHeight=function(n){let e=5e6,t=null;for(let r=0;r<n.length;r++){let s=n[r].z;s<e&&(e=s,t=this._ellipsoidToLonLat(n[r]))}return t.altitude};ne.prototype._ellipsoidToLonLat=function(n){let e=this.viewer.scene.globe.ellipsoid,t=new i.Cesium.Cartesian3(n.x,n.y,n.z),r=e.cartesianToCartographic(t),s=i.Cesium.Math.toDegrees(r.latitude),o=i.Cesium.Math.toDegrees(r.longitude),a=r.height;return{longitude:o,latitude:s,altitude:a}};ne.prototype._createBottomSurface=function(n){if(n.length){let r=this._getMinHeight(n),s=[];for(let l=0;l<n.length;l++){let h=this._ellipsoidToLonLat(n[l]);s.push(h.longitude),s.push(h.latitude),s.push(r)}let o=new i.Cesium.PolygonGeometry({polygonHierarchy:new i.Cesium.PolygonHierarchy(i.Cesium.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,closeBottom:!1}),a=i.Cesium.PolygonGeometry.createGeometry(o);var e=new i.Cesium.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),t=new i.Cesium.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new i.Cesium.Primitive({geometryInstances:new i.Cesium.GeometryInstance({geometry:a}),appearance:t,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}};ne.prototype._createWellWall=function(n,e){let t=this._getMinHeight(n),r=[],s=[];for(let c=0;c<e.length;c++)r.push(this._ellipsoidToLonLat(e[c]).altitude),s.push(t);let o=new i.Cesium.WallGeometry({positions:e,maximumHeights:r,minimumHeights:s}),a=i.Cesium.WallGeometry.createGeometry(o);var l=new i.Cesium.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),h=new i.Cesium.MaterialAppearance({translucent:!1,flat:!0,material:l});this.wellWall=new i.Cesium.Primitive({geometryInstances:new i.Cesium.GeometryInstance({geometry:a,attributes:{color:i.Cesium.ColorGeometryInstanceAttribute.fromColor(i.Cesium.Color.GREY)},id:"PitWall"}),appearance:h,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)};ne.prototype._switchExcavate=function(n){n?(this.viewer.scene.globe.material=i.Cesium.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)};ne.prototype._updateExcavateDepth=function(n){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,t=[],r=e.length,s=0;s<r;s++)t.push(i.Cesium.Cartesian3.fromRadians(e[s].longitude,e[s].latitude,this.excavateMinHeight-n));this.wellData.bottom_pos=t,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)};var zd=ne;var al=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.Cesium.CustomDataSource("TerrainUplift"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._upHeight=t.upHeight||0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.Cesium.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=p.INITIALIZED,this._callback=null}get type(){return"TerrainUplift"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(a=>i.Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.Cesium.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.Cesium.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let a=o.map(l=>i.Cesium.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.Cesium.sampleTerrainMostDetailed(s,a).then(l=>{let h=l.map(c=>{let d=i.Cesium.Math.toDegrees(c.longitude),f=i.Cesium.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:f,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),a=this._adjustTerrainHeight(e),l={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0};this._area.push(l),typeof this._callback=="function"&&this._callback(l)}_adjustTerrainHeight(e,t=1e3){console.log(111111111111);let r=new i.Cesium.EllipsoidSurfaceAppearance({}),s=[];e.forEach(l=>{s.push(parseFloat(l.lng)),s.push(parseFloat(l.lat)),s.push(this._minHeight+t)});let o=new i.Cesium.PolygonHierarchy(i.Cesium.Cartesian3.fromDegreesArrayHeights(s));return this._layer.entities.add({polygon:{hierarchy:o,material:r.material,perPositionHeight:!0,outline:!1,outlineColor:i.Cesium.Color.BLUE}}).id}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cesium.Cartesian3.fromDegreesArray(t),material:new i.Cesium.ImageMaterialProperty({image:this._image,repeat:new i.Cesium.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.Cesium.PolygonHierarchy(i.Cesium.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.Cesium.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cesium.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Cesium.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cesium.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cesium.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Cesium.Math.lerp(o.longitude,a.longitude,l/r),c=i.Cesium.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Cesium.Math.toDegrees(h),lat:i.Cesium.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(a=>i.Cesium.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.Cesium.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Hd=al;var nl=class{constructor(e){ni(this,"_analysisTerrainVisible",e=>{let t=this._viewer.terrainProvider,r=e.map(s=>i.Cesium.Cartographic.fromDegrees(s.lng,s.lat,s.alt));i.Cesium.sampleTerrainMostDetailed(t,r).then(s=>{let o=0,a=null;for(let l=0;l<s.length-1;l++){if(l<s.length-2){let h=e[l],c=e[l+1],d=i.Cesium.Cartesian3.fromDegrees(h.lng,h.lat,h.alt),f=i.Cesium.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);if(a=this._analysisModelVisible([d,f]),i.Cesium.defined(a)&&i.Cesium.defined(a.object)){console.log("\u5728\u6A21\u578B\u4E0A.");let T=i.Cesium.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),y=i.Cesium.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(a.position,T,i.Cesium.Color.GREEN),this._drawLine(a.position,y,i.Cesium.Color.RED);break}}if(s[l].height>=e[l].alt){console.log("\u5728\u5730\u5F62\u4E0A."),o=l;let h=i.Cesium.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),c=i.Cesium.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),d=i.Cesium.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(h,c,i.Cesium.Color.GREEN),this._drawLine(c,d,i.Cesium.Color.RED);break}}if(o===0&&a===null){console.log("\u5168\u90E8\u53EF\u89C6.");let l=i.Cesium.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),h=i.Cesium.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(l,h,i.Cesium.Color.GREEN)}})});ni(this,"_analysisModelVisible",e=>{let t=i.Cesium.Cartesian3.normalize(i.Cesium.Cartesian3.subtract(e[1],e[0],new i.Cesium.Cartesian3),new i.Cesium.Cartesian3),r=new i.Cesium.Ray(e[0],t);return this._viewer.scene.pickFromRay(r)});this._id=v.uuid(),this._viewer=e,this._layer=new i.Cesium.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)}get type(){return"sightLine"}get layer(){return this._layer}_init(e,t,r=10){this._layer&&this._layer.entities.removeAll();let s=i.Cesium.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),o=i.Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),a=this._viewer.terrainProvider;if(a&&!(a instanceof i.Cesium.EllipsoidTerrainProvider)){let l=this._lerp(e,t,r).concat([t]);this._analysisTerrainVisible(l)}else this._analysisVisible([s,o])}_analysisVisible(e){let t=this._analysisModelVisible(e);if(i.Cesium.defined(t)&&i.Cesium.defined(t.object)){let r=this._drawLine(t.position,e[0],i.Cesium.Color.GREEN),s=this._drawLine(t.position,e[1],i.Cesium.Color.RED);console.log("\u5728\u6A21\u578B\u4E0A.",r,s)}else{let r=this._drawLine(e[0],e[1],i.Cesium.Color.GREEN);console.log("\u4E0D\u5728\u6A21\u578B\u4E0A",r)}}_drawLine(e,t,r){return this._layer||(this._layer=new i.Cesium.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)),this._layer&&this._layer.entities.add({polyline:{positions:[e,t],width:2,material:r,depthFailMaterial:r}}),this}_lerp(e,t,r=10){let s=[],o=i.Cesium.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cesium.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Cesium.Math.lerp(o.longitude,a.longitude,l/r),c=i.Cesium.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Cesium.Math.toDegrees(h),lat:i.Cesium.Math.toDegrees(c),alt:d})}return s}deactivate(){this._layer&&this._layer.entities.removeAll(),this._layer&&this._viewer.dataSources.remove(this._layer),this._layer=null}},Nd=nl;var ll=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._contourLine=new Od(e),this._tilesetShake=new kd(e),this._sightLine=new Nd(e)}get ContourLine(){return this._contourLine}get TilesetShake(){return this._tilesetShake}get SightLine(){return this._sightLine}contourLine(e,t,r){this._contourLine._init(e,t,r)}tilesetShake(e,t){this._tilesetShake._init(e,t)}terrainClip(e={}){return new Fd(this._viewer,e)}terrainClipPlan(e={}){return new zd(this._viewer,e)}terrainUplift(e={}){return new Hd(this._viewer,e)}sightLine(e,t,r){return this._sightLine._init(e,t,r)}deactivate(e=null){switch(e){case lt.SIGHT_LINE:this._sightLine.deactivate();break;default:this._contourLine.deactivate(),this._tilesetShake.deactivate();break}return this}},hl=ll;var cl=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(C.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(C.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(C.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(C.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(C.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(C.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},Wd=cl;var dl=class extends Wd{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Cesium.Entity({polyline:{...this._style,positions:new i.Cesium.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(C.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(C.DRAW_STOP,e))}},Gd=dl;var pl=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Cesium.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Cesium.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.Cesium.EllipsoidTerrainProvider)?i.Cesium.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cesium.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cesium.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onComputedStop(e,t=!1){let r=[];return t?r=e.map((s,o)=>{let l=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),h=0;for(let c=1;c<=o;c++){let d=i.Cesium.Cartesian3.distance(e[c-1],e[c]);h+=d}return{longitude:i.Cesium.Math.toDegrees(l.longitude),latitude:i.Cesium.Math.toDegrees(l.latitude),height:l.height,distance:h,cartesian3Position:s}}):r=e.map((s,o)=>{let a=0;for(let l=1;l<=o;l++){let h=i.Cesium.Cartesian3.fromRadians(e[l-1].longitude,e[l-1].latitude,e[l-1].height),c=i.Cesium.Cartesian3.fromRadians(e[l].longitude,e[l].latitude,e[l].height),d=i.Cesium.Cartesian3.distance(h,c);a+=d}return{longitude:i.Cesium.Math.toDegrees(s.longitude),latitude:i.Cesium.Math.toDegrees(s.latitude),height:s.height,distance:a,cartesian3Position:i.Cesium.Cartesian3.fromRadians(s.longitude,s.latitude,s.height)}}),r}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},Ud=pl;var ml=class extends Ud{constructor(){super(),this._maxAnchorSize=9999,this._positions=[],this._includeModel=!0,this._callback=null}_lerp(e,t,r=5){let s=[],o=i.Cesium.Cartographic.fromCartesian(e),a=i.Cesium.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Cesium.Math.lerp(o.longitude,a.longitude,l/r),c=i.Cesium.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push(i.Cesium.Cartesian3.fromRadians(h,c,d))}return s}async _onDrawStop(e){let t=this._positions.filter((s,o)=>o!==1),r=await this._onComputedStop(t,this._includeModel);typeof this._callback=="function"&&await this._callback(r)}_stoppedHook(){this._options.onDrawStop&&this._options.onDrawStop(entity)}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t,this._includeModel).then(([r,s])=>(this._includeModel||(this._positions=r),r.map((o,a)=>i.Cesium.Cartesian3.fromDegrees(i.Cesium.Math.toDegrees(o.longitude),i.Cesium.Math.toDegrees(o.latitude),Math.max(o.height||0,s[a]?i.Cesium.Cartographic.fromCartesian(s[a]).height:0))))).then(r=>{this._includeModel&&(this._positions=r);let s=0;for(let o=0;o<r.length-1;o++){let a=i.Cesium.Cartesian3.distance(r[o],r[o+1]);s+=a}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t,r={}){return this._startHook(e,r),new Gd({material:r.material||i.Cesium.Color.YELLOW.withAlpha(.6),depthFailMaterial:r.depthFailMaterial||new i.Cesium.PolylineDashMaterialProperty({color:i.Cesium.Color.YELLOW.withAlpha(.6)}),width:r.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this._includeModel=r==null?void 0:r.includeModel,this._callback=t,this}},Bd=ml;var ul=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.Cesium.CustomDataSource("plotAnalysis-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}profile(e,t={}){var r;return(r=new Bd)==null||r.start(this,e,t),this}activate(e,t){switch(e){case ht.PROFILE:this.profile(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},_l=ul;var fl=class{static init(){let e=me("turf");if(!e)throw new Error("miss the turf lib");return e}static pointBuffer(e,t=50,r=8){let s=this.init(),o=_.parsePosition(e),a=s.point([o.lng,o.lat,o.alt]),l=s.buffer(a,t,{units:"meters",steps:r}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static polylineBuffer(e,t=50,r=8){let s=this.init(),a=_.parsePositions(e).map(d=>[d.lng,d.lat,d.alt]),l=s.lineString(a),h=s.buffer(l,t,{units:"meters",steps:r}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static polygonBuffer(e,t=50,r=8){let s=this.init(),o=_.parsePositions(e),a=o.concat(o[0]).map(d=>[d.lng,d.lat,d.alt]),l=s.polygon([a]),h=s.buffer(l,t,{units:"meters",steps:r}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static transformPolylineScale(e,t=1){let r=this.init(),o=_.parsePositions(e).map(c=>[c.lng,c.lat,c.alt]),a=r.lineString(o),l=r.transformScale(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h}static transformPolygonScale(e,t){let r=this.init(),s=_.parsePositions(e),o=s.concat(s[0]).map(c=>[c.lng,c.lat,c.alt]),a=r.polygon([o]),l=r.transformScale(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static transformPolylineRotate(e,t=0){let r=this.init(),o=_.parsePositions(e).map(c=>[c.lng,c.lat,c.alt]),a=r.lineString(o),l=r.transformRotate(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h}static transformPolygonRotate(e,t=0){let r=this.init(),s=_.parsePositions(e),o=s.concat(s[0]).map(c=>[c.lng,c.lat,c.alt]),a=r.polygon([o]),l=r.transformRotate(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static sector(e,t,r,s){let o=this.init(),a=_.parsePosition(e),l=o.point([a.lng,a.lat,a.alt]),h=o.sector(l,t,r,s,{units:"meters"}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static polygonEquivalent(e,t,r,s=null){let o=this.init(),a=[];for(let d=0,f=e.length;d<f;d++){let T=e[d];a.push({type:"Feature",properties:T,geometry:{type:"Point",coordinates:[T.x,T.y]}})}let l={type:"FeatureCollection",features:a};s&&s!==null&&(l=o.interpolate(l,s.cellSize||10,{gridType:"point",property:r,units:(s==null?void 0:s.units)||"kilometers",weight:(s==null?void 0:s.weight)||1}),l.features.map(d=>d.properties[r]=Number(d.properties[r].toFixed(2))));let h=o.isobands(l,t,{zProperty:r}),c=o.isolines(l,t,{zProperty:r});return{geojsonPoly:h,geojsonLine:c}}},gl=fl;var Nu=i.Cesium.Cartesian2,Wu=i.Cesium.Cartesian3,Gu=i.Cesium.Matrix3,Uu=i.Cesium.Matrix4,Bu=i.Cesium.Material,Vu=i.Cesium.SceneMode,ju=i.Cesium.SkyBox,Yu=i.Cesium.Color,Zu=i.Cesium.Rectangle,qu=i.Cesium.ShadowMode,Xu=i.Cesium.JulianDate,Ju=i.Cesium.HeightReference,Ku=i.Cesium.HorizontalOrigin,Qu=i.Cesium.VerticalOrigin,$u=i.Cesium.CallbackProperty,e_=i.Cesium.ClassificationType,t_=i.Cesium.Cesium3DTileStyle,i_=i.Cesium.GeographicTilingScheme,r_=i.Cesium.WebMercatorTilingScheme,s_=i.Cesium.ColorMaterialProperty,o_=i.Cesium.ImageMaterialProperty,a_=i.Cesium.PolylineDashMaterialProperty,n_=i.Cesium.PolylineGlowMaterialProperty,l_=i.Cesium.PolylineOutlineMaterialProperty,h_=i.Cesium.PolylineArrowMaterialProperty,c_=i.Cesium.writeTextToCanvas,d_=i.Cesium.CustomShaderMode,p_=i.Cesium.CustomShaderTranslucencyMode,m_=i.Cesium.CustomShader,u_=i.Cesium.UniformType,__=i.Cesium.Ellipsoid,f_=i.Cesium.Resource,g_=i.Cesium.createGooglePhotorealistic3DTileset,y_=i.Cesium.createElevationBandMaterial,v_=i.Cesium.ModelAnimationLoop,w_=i.Cesium.ClippingPlane,T_=i.Cesium.ClippingPlaneCollection,C_=i.Cesium.ClippingPolygon,x_=i.Cesium.ClippingPolygonCollection;var E_="./libs/gm-sdk/resources/",Vd=E_,jd=!1,P_={set baseUrl(n){Vd=n},get baseUrl(){return Vd}};function b_(n={}){return jd?Promise.resolve():(Yd&&Yd(),new Promise((e,t)=>{n.baseUrl&&(this.config.baseUrl=n.baseUrl),n.echarts&&(Gl(n.echarts),pe("echarts",n.echarts)),n.turf&&pe("turf",n.turf),n.shpUtil&&pe("shpUtil",n.shpUtil),jd=!0,mt("isInitialized",!0),mt("baseUrl",this.config.baseUrl),e()}).catch(e=>{throw new Error(e.message)}))}function Yd(){console.clear(),console.log(`%c
17517
17517
  GM-SDK %c %c
17518
17518
 
17519
- \u7248\u672C: 1.12.1 - 2025-02-08
17520
- \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")}var S_="1.12.1";return ip(I_);})();
17519
+ \u7248\u672C: 1.12.2 - 2025-02-08
17520
+ \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")}var S_="1.12.2";return ip(I_);})();
package/dist/index.js CHANGED
@@ -1749,5 +1749,5 @@ void main(){
1749
1749
  `}_init(e,t={}){this._enable=!0,this._maxDistance=t.maxDistance||5,this._speed=t.speed||1e3,this._maxHeight=t.maxHeight||20,e&&(this._layer=e,this.tileset_arr=this._layer.delegate._primitives.map(r=>({overlayId:r.overlayId,tileset2:r,tileset:this._layer._cache[r.overlayId]||null})),this.tileset_arr.forEach(r=>{let s=this._getShader(r.tileset2);r.tileset.setCustomShader(s)}))}deactivate(){this._enable=!1,!(!this.tileset_arr||this.tileset_arr.length===0)&&this.tileset_arr.forEach(e=>{let t=new window.GM.CustomShader;e.tileset.setCustomShader(t)})}},xd=xa;var Ea=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("terrainClip"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=p.INITIALIZED,this._callback=null}get type(){return"terrainClip"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(a=>i.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let a=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,a).then(l=>{let h=l.map(c=>{let d=i.Math.toDegrees(c.longitude),f=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:f,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),a={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,show:!0};this._area.push({id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0}),typeof this._callback=="function"&&this._callback(a)}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,a.longitude,l/r),c=i.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(a=>i.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},Ed=Ea;function ne(n,e){this.viewer=n,this.options=e||{},this._positions=[new i.Cartesian3(-1.1825928630924462e6,5.5155809806405855e6,2966674365247578e-9),new i.Cartesian3(-1183337777477057e-9,5515825617716778e-9,2.9659274345367434e6),new i.Cartesian3(-1.1845084932830015e6,5515571328839522e-9,2965932974956288e-9),new i.Cartesian3(-1.1855870332886775e6,5514889448799464e-9,2.9667642948399023e6),new i.Cartesian3(-1.1850990292063756e6,5514576687407264e-9,2967535347584739e-9),new i.Cartesian3(-1.1828409384216308e6,551522464431188e-8,2.9672341119776894e6)],this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=i.defaultValue(e.splitNum,50),this._positions&&this._positions.length>0&&this.updateData(this._positions)}Object.defineProperties(ne.prototype,{show:{get:function(){return this._show},set:function(n){this._show=n,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=n),this._switchExcavate(n)}},height:{get:function(){return this._height},set:function(n){this._height=n,this._updateExcavateDepth(n)}}});ne.prototype.updateData=function(n){this.clear();var e=[],t=n.length,r=new i.Cartesian3,s=i.Cartesian3.subtract(n[0],n[1],r);s=s.x>0,this.excavateMinHeight=9999;for(var o=0;o<t;++o){var a=(o+1)%t,l=i.Cartographic.fromCartesian(n[o]),h=viewer.scene.globe.getHeight(l)||l.height;h<this.excavateMinHeight&&(this.excavateMinHeight=h);var c=i.Cartesian3.add(n[o],n[a],new i.Cartesian3);c=i.Cartesian3.multiplyByScalar(c,.5,c);var d=i.Cartesian3.normalize(c,new i.Cartesian3),f=i.Cartesian3.subtract(n[a],c,new i.Cartesian3);f=i.Cartesian3.normalize(f,f);var T=i.Cartesian3.cross(f,d,new i.Cartesian3);T=i.Cartesian3.normalize(T,T);var y=new i.Plane(T,0),m=i.Plane.getPointDistance(y,c);e.push(new i.ClippingPlane(T,m))}this.viewer.scene.globe.clippingPlanes=new i.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:i.Color.WHITE,enabled:!0}),this._prepareWell(n),this._createWell(this.wellData)};ne.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()};ne.prototype._prepareWell=function(n){var e=this.splitNum,t=n.length;if(t!=0){for(var r=this.excavateMinHeight-this.height,s=[],o=[],a=[],l=0;l<t;l++){var h=l==t-1?0:l+1,c=i.Cartographic.fromCartesian(n[l]),d=i.Cartographic.fromCartesian(n[h]),f=[c.longitude,c.latitude],T=[d.longitude,d.latitude];l==0&&(a.push(new i.Cartographic(f[0],f[1])),o.push(i.Cartesian3.fromRadians(f[0],f[1],r)),s.push(i.Cartesian3.fromRadians(f[0],f[1],0)));for(var y=1;y<=e;y++){var m=i.Math.lerp(f[0],T[0],y/e),E=i.Math.lerp(f[1],T[1],y/e);l==t-1&&y==e||(a.push(new i.Cartographic(m,E)),o.push(i.Cartesian3.fromRadians(m,E,r)),s.push(i.Cartesian3.fromRadians(m,E,0)))}}this.wellData={lerp_pos:a,bottom_pos:o,no_height_top:s}}};ne.prototype._createWell=function(n){if(this.viewer.terrainProvider._layers){var e=this;this._createBottomSurface(n.bottom_pos);var t=i.sampleTerrainMostDetailed(this.viewer.terrainProvider,n.lerp_pos);i.when(t,function(r){for(var s=r.length,o=[],a=0;a<s;a++){var l=i.Cartesian3.fromRadians(r[a].longitude,r[a].latitude,r[a].height);o.push(l)}e._createWellWall(n.bottom_pos,o)})}else this._createBottomSurface(n.bottom_pos),this._createWellWall(n.bottom_pos,n.no_height_top)};ne.prototype._getMinHeight=function(n){let e=5e6,t=null;for(let r=0;r<n.length;r++){let s=n[r].z;s<e&&(e=s,t=this._ellipsoidToLonLat(n[r]))}return t.altitude};ne.prototype._ellipsoidToLonLat=function(n){let e=this.viewer.scene.globe.ellipsoid,t=new i.Cartesian3(n.x,n.y,n.z),r=e.cartesianToCartographic(t),s=i.Math.toDegrees(r.latitude),o=i.Math.toDegrees(r.longitude),a=r.height;return{longitude:o,latitude:s,altitude:a}};ne.prototype._createBottomSurface=function(n){if(n.length){let r=this._getMinHeight(n),s=[];for(let l=0;l<n.length;l++){let h=this._ellipsoidToLonLat(n[l]);s.push(h.longitude),s.push(h.latitude),s.push(r)}let o=new i.PolygonGeometry({polygonHierarchy:new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(s)),perPositionHeight:!0,closeBottom:!1}),a=i.PolygonGeometry.createGeometry(o);var e=new i.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),t=new i.MaterialAppearance({translucent:!1,flat:!0,material:e});this.bottomSurface=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:a}),appearance:t,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}};ne.prototype._createWellWall=function(n,e){let t=this._getMinHeight(n),r=[],s=[];for(let c=0;c<e.length;c++)r.push(this._ellipsoidToLonLat(e[c]).altitude),s.push(t);let o=new i.WallGeometry({positions:e,maximumHeights:r,minimumHeights:s}),a=i.WallGeometry.createGeometry(o);var l=new i.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),h=new i.MaterialAppearance({translucent:!1,flat:!0,material:l});this.wellWall=new i.Primitive({geometryInstances:new i.GeometryInstance({geometry:a,attributes:{color:i.ColorGeometryInstanceAttribute.fromColor(i.Color.GREY)},id:"PitWall"}),appearance:h,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)};ne.prototype._switchExcavate=function(n){n?(this.viewer.scene.globe.material=i.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)};ne.prototype._updateExcavateDepth=function(n){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,t=[],r=e.length,s=0;s<r;s++)t.push(i.Cartesian3.fromRadians(e[s].longitude,e[s].latitude,this.excavateMinHeight-n));this.wellData.bottom_pos=t,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)};var Pd=ne;var Pa=class{constructor(e,t={}){if(!e)throw Error("missing viewer param");this._id=v.uuid(),this._viewer=e,this._delegate=void 0,this._layer=new i.CustomDataSource("TerrainUplift"),e.dataSources.add(this._layer),this._minHeight=null,this._currentHeight=[],this._area=[],this._enable=t.enable||!0,this._upHeight=t.upHeight||0,this._clipOutSide=t.clipOutSide||!1,this._diffHeight=t.diffHeight||0,this._image=t.image||"//data.mars3d.cn/img/textures/poly-land.png",this._imageBottom=t.imageBottom||"//data.mars3d.cn/img/textures/poly-soil.jpg",this._splitNum=t.splitNum||30,this._clippingPolygons=new i.ClippingPolygonCollection({enabled:this._enable,polygons:[],inverse:this._clipOutSide}),this._viewer.scene.globe.backFaceCulling=!0,this._viewer.scene.globe.showSkirts=!0,this._state=p.INITIALIZED,this._callback=null}get type(){return"TerrainUplift"}get layer(){return this._layer}set enable(e){this._enable=e,this._viewer.scene.globe.clippingPolygons.enabled=e}get enable(){return this._enable}set clipOutSide(e){this._clipOutSide=e,this._viewer.scene.globe.clippingPolygons.inverse=e}get clipOutSide(){return this._clipOutSide}set splitNum(e){this._splitNum=e}get splitNum(){return this._splitNum}set diffHeight(e){this._diffHeight=e}get diffHeight(){return this._diffHeight}addArea(e=[],t={},r){t!=null&&t.diffHeight&&(this._diffHeight=t.diffHeight);let s=e.map(a=>i.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.ClippingPolygon({positions:s});this._id=v.uuid(),o.id=this._id,this._clippingPolygons.add(o),this._viewer.scene.globe.clippingPolygons=this._clippingPolygons,this._prepareWall(e,t),this._callback=r}_prepareWall(e,t={}){let r=e.concat([e[0]]);this._minHeight=null,this._currentHeight=[];let s=this._viewer.terrainProvider;if(s&&!(s instanceof i.EllipsoidTerrainProvider)){let o=[];for(let l=0;l<r.length-1;l++){let h=this._lerp(r[l],r[l+1],this._splitNum);o=o.concat(h)}o.push(r[0]);let a=o.map(l=>i.Cartographic.fromDegrees(l.lng,l.lat,l.alt));i.sampleTerrainMostDetailed(s,a).then(l=>{let h=l.map(c=>{let d=i.Math.toDegrees(c.longitude),f=i.Math.toDegrees(c.latitude);return this._currentHeight.push(parseFloat(c.height)),(!this._minHeight||c.height<this._minHeight)&&(this._minHeight=c.height),{lng:d,lat:f,alt:c.height}});this._perCreateEntity(e,h,t)})}else r.forEach(o=>{this._currentHeight.push(parseFloat(o.alt)),(!this._minHeight||o.alt<this._minHeight)&&(this._minHeight=o.alt)}),this._perCreateEntity(r,r,t)}_perCreateEntity(e,t,r){let s=this._createWallSurface(t),o=this._createBottomSurface(e),a=this._adjustTerrainHeight(e),l={id:this._id,diffHeight:this._diffHeight,original:r,positions:e,entityIds:[s,o],show:!0};this._area.push(l),typeof this._callback=="function"&&this._callback(l)}_adjustTerrainHeight(e,t=1e3){console.log(111111111111);let r=new i.EllipsoidSurfaceAppearance({}),s=[];e.forEach(l=>{s.push(parseFloat(l.lng)),s.push(parseFloat(l.lat)),s.push(this._minHeight+t)});let o=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(s));return this._layer.entities.add({polygon:{hierarchy:o,material:r.material,perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_createWallSurface(e){let t=[];return e.forEach(s=>{t.push(parseFloat(s.lng)),t.push(parseFloat(s.lat))}),this._layer.entities.add({wall:{positions:i.Cartesian3.fromDegreesArray(t),material:new i.ImageMaterialProperty({image:this._image,repeat:new i.Cartesian2(8,1)}),minimumHeights:this._getHeights(e.length,this._minHeight-this._diffHeight),maximumHeights:this._currentHeight}}).id}_createBottomSurface(e){let t=[];e.forEach(o=>{t.push(parseFloat(o.lng)),t.push(parseFloat(o.lat)),t.push(this._minHeight-this._diffHeight)});let r=new i.PolygonHierarchy(i.Cartesian3.fromDegreesArrayHeights(t));return this._layer.entities.add({polygon:{hierarchy:r,material:new i.ImageMaterialProperty({image:this._imageBottom,repeat:new i.Cartesian2(1,2)}),perPositionHeight:!0,outline:!1,outlineColor:i.Color.BLUE}}).id}_getHeights(e,t){let r=[];for(let s=0;s<e;s++)r.push(t);return r}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,a.longitude,l/r),c=i.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}getAreaById(e){let t=this._area.filter(r=>r.id===e);return t&&t.length>0?t[0]:null}removeArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];this._layer.entities.removeById(r.entityIds[0]),this._layer.entities.removeById(r.entityIds[1]);let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return this._area.splice(t,1),o&&this._clippingPolygons.remove(o),this}showArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(r.show)return;r.show=!0,this._layer.entities.getById(r.entityIds[0]).show=!0,this._layer.entities.getById(r.entityIds[1]).show=!0;let s=r.positions.map(a=>i.Cartesian3.fromDegrees(a.lng,a.lat,a.alt)),o=new i.ClippingPolygon({positions:s});return o.id=e,this._clippingPolygons.add(o),this}hideArea(e){let t=this._area.findIndex(a=>a.id===e);if(t==null)throw Error("missing index result");let r=this._area[t];if(!r.show)return;r.show=!1,this._layer.entities.getById(r.entityIds[0]).show=!1,this._layer.entities.getById(r.entityIds[1]).show=!1;let s=this._clippingPolygons._polygons.findIndex(a=>a.id===e),o=this._clippingPolygons.get(s);return o&&this._clippingPolygons.remove(o),this}flyToArea(e){let t=this._area.findIndex(o=>o.id===e);if(t==null)throw Error("missing index result");let r=this._area[t],s=this._layer.entities.getById(r.entityIds[0]);return this._viewer.flyTo(s),this}toJSON(){return this._area}clear(){this._layer.entities.removeAll(),this._clippingPolygons.removeAll()}},bd=Pa;var ba=class{constructor(e){ai(this,"_analysisTerrainVisible",e=>{let t=this._viewer.terrainProvider,r=e.map(s=>i.Cartographic.fromDegrees(s.lng,s.lat,s.alt));i.sampleTerrainMostDetailed(t,r).then(s=>{let o=0,a=null;for(let l=0;l<s.length-1;l++){if(l<s.length-2){let h=e[l],c=e[l+1],d=i.Cartesian3.fromDegrees(h.lng,h.lat,h.alt),f=i.Cartesian3.fromDegrees(c.lng,c.lat,c.alt);if(a=this._analysisModelVisible([d,f]),i.defined(a)&&i.defined(a.object)){console.log("\u5728\u6A21\u578B\u4E0A.");let T=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),y=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(a.position,T,i.Color.GREEN),this._drawLine(a.position,y,i.Color.RED);break}}if(s[l].height>=e[l].alt){console.log("\u5728\u5730\u5F62\u4E0A."),o=l;let h=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),c=i.Cartesian3.fromDegrees(e[l].lng,e[l].lat,e[l].alt),d=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(h,c,i.Color.GREEN),this._drawLine(c,d,i.Color.RED);break}}if(o===0&&a===null){console.log("\u5168\u90E8\u53EF\u89C6.");let l=i.Cartesian3.fromDegrees(e[0].lng,e[0].lat,e[0].alt),h=i.Cartesian3.fromDegrees(e[e.length-1].lng,e[e.length-1].lat,e[e.length-1].alt);this._drawLine(l,h,i.Color.GREEN)}})});ai(this,"_analysisModelVisible",e=>{let t=i.Cartesian3.normalize(i.Cartesian3.subtract(e[1],e[0],new i.Cartesian3),new i.Cartesian3),r=new i.Ray(e[0],t);return this._viewer.scene.pickFromRay(r)});this._id=v.uuid(),this._viewer=e,this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)}get type(){return"sightLine"}get layer(){return this._layer}_init(e,t,r=10){this._layer&&this._layer.entities.removeAll();let s=i.Cartesian3.fromDegrees(e.lng,e.lat,e.alt),o=i.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),a=this._viewer.terrainProvider;if(a&&!(a instanceof i.EllipsoidTerrainProvider)){let l=this._lerp(e,t,r).concat([t]);this._analysisTerrainVisible(l)}else this._analysisVisible([s,o])}_analysisVisible(e){let t=this._analysisModelVisible(e);if(i.defined(t)&&i.defined(t.object)){let r=this._drawLine(t.position,e[0],i.Color.GREEN),s=this._drawLine(t.position,e[1],i.Color.RED);console.log("\u5728\u6A21\u578B\u4E0A.",r,s)}else{let r=this._drawLine(e[0],e[1],i.Color.GREEN);console.log("\u4E0D\u5728\u6A21\u578B\u4E0A",r)}}_drawLine(e,t,r){return this._layer||(this._layer=new i.CustomDataSource("sightLine"),this._viewer.dataSources.add(this._layer)),this._layer&&this._layer.entities.add({polyline:{positions:[e,t],width:2,material:r,depthFailMaterial:r}}),this}_lerp(e,t,r=10){let s=[],o=i.Cartographic.fromDegrees(e.lng,e.lat,e.alt),a=i.Cartographic.fromDegrees(t.lng,t.lat,t.alt);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,a.longitude,l/r),c=i.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push({lng:i.Math.toDegrees(h),lat:i.Math.toDegrees(c),alt:d})}return s}deactivate(){this._layer&&this._layer.entities.removeAll(),this._layer&&this._viewer.dataSources.remove(this._layer),this._layer=null}},Sd=ba;var Sa=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._contourLine=new Cd(e),this._tilesetShake=new xd(e),this._sightLine=new Sd(e)}get ContourLine(){return this._contourLine}get TilesetShake(){return this._tilesetShake}get SightLine(){return this._sightLine}contourLine(e,t,r){this._contourLine._init(e,t,r)}tilesetShake(e,t){this._tilesetShake._init(e,t)}terrainClip(e={}){return new Ed(this._viewer,e)}terrainClipPlan(e={}){return new Pd(this._viewer,e)}terrainUplift(e={}){return new bd(this._viewer,e)}sightLine(e,t,r){return this._sightLine._init(e,t,r)}deactivate(e=null){switch(e){case $t.SIGHT_LINE:this._sightLine.deactivate();break;default:this._contourLine.deactivate(),this._tilesetShake.deactivate();break}return this}},Id=Sa;var Ia=class{constructor(e){this._style=e,this._viewer=void 0,this._layer=void 0,this._delegate=void 0,this._options={},this._positions=[]}get drawTool(){return this._viewer.drawTool}_mountedHook(){}_onDrawAnchor(e){}_onAnchorMoving(e){this._positions.pop(),this._positions.push(e),this._options.onCalc&&this._options.onCalc(this._positions)}_onDrawStop(){this._unbindEvent(),this._viewer.drawTool.deactivate(),this._options.onDrawStop&&this._options.onDrawStop(this._delegate)}_bindEvent(){this.drawTool.on(C.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.on(C.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.on(C.DRAW_STOP,this._onDrawStop,this)}_unbindEvent(){this.drawTool.off(C.DRAW_ANCHOR,this._onDrawAnchor,this),this.drawTool.off(C.ANCHOR_MOVING,this._onAnchorMoving,this),this.drawTool.off(C.DRAW_STOP,this._onDrawStop,this)}start(e,t){return this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._viewer.editTool.deactivate(),this._viewer.drawTool.activate(t),this._mountedHook(),this._unbindEvent(),this._bindEvent(),this}},Md=Ia;var Ma=class extends Md{constructor(e){super(e)}_mountedHook(){this.drawTool.tooltipMess="\u5DE6\u51FB\u9009\u62E9\u70B9\u4F4D,\u53F3\u51FB\u7ED3\u675F",this._delegate=new i.Entity({polyline:{...this._style,positions:new i.CallbackProperty(()=>this._positions,!1)}}),this._layer.entities.add(this._delegate)}_onDrawAnchor(e){let t=this._positions.length;this._positions.push(e),t>0&&this.drawTool.fire(C.CREATE_ANCHOR,{position:e}),t>=this._options.maxAnchorSize&&(this._positions.pop(),this.drawTool.fire(C.DRAW_STOP,e))}},Ad=Ma;var Aa=class{constructor(){this._viewer=void 0,this._layer=void 0,this._startLabel=new i.Entity({label:{text:"\u5F00\u59CB",font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._resultLabel=new i.Entity({label:{font:"12px",pixelOffset:{x:0,y:-15},disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0}}),this._options={}}_getSampledHeight(e,t=!1){let r=this._viewer.terrainProvider&&!(this._viewer.terrainProvider instanceof i.EllipsoidTerrainProvider)?i.sampleTerrainMostDetailed(this._viewer.terrainProvider,e.map(o=>i.Cartographic.fromCartesian(o))):Promise.resolve(e.map(o=>i.Cartographic.fromCartesian(o))),s=this._viewer.scene.clampToHeightSupported&&t?this._viewer.scene.clampToHeightMostDetailed(e,this._layer.entities.values):Promise.resolve(e);return Promise.all([r,s])}_onDrawStop(e){}_onComputedStop(e,t=!1){let r=[];return t?r=e.map((s,o)=>{let l=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(s),h=0;for(let c=1;c<=o;c++){let d=i.Cartesian3.distance(e[c-1],e[c]);h+=d}return{longitude:i.Math.toDegrees(l.longitude),latitude:i.Math.toDegrees(l.latitude),height:l.height,distance:h,cartesian3Position:s}}):r=e.map((s,o)=>{let a=0;for(let l=1;l<=o;l++){let h=i.Cartesian3.fromRadians(e[l-1].longitude,e[l-1].latitude,e[l-1].height),c=i.Cartesian3.fromRadians(e[l].longitude,e[l].latitude,e[l].height),d=i.Cartesian3.distance(h,c);a+=d}return{longitude:i.Math.toDegrees(s.longitude),latitude:i.Math.toDegrees(s.latitude),height:s.height,distance:a,cartesian3Position:i.Cartesian3.fromRadians(s.longitude,s.latitude,s.height)}}),r}_onCalc(e){}_startHook(e,t){this._viewer=e.viewer,this._layer=e.layer,this._options=t,this._options.onDrawStop=this._onDrawStop.bind(this),this._options.onCalc=this._onCalc.bind(this),this._layer.entities.add(this._startLabel),this._layer.entities.add(this._resultLabel)}start(e,t){return this}},Dd=Aa;var Da=class extends Dd{constructor(){super(),this._maxAnchorSize=9999,this._positions=[],this._includeModel=!0,this._callback=null}_lerp(e,t,r=5){let s=[],o=i.Cartographic.fromCartesian(e),a=i.Cartographic.fromCartesian(t);for(let l=0;l<r;l++){let h=i.Math.lerp(o.longitude,a.longitude,l/r),c=i.Math.lerp(o.latitude,a.latitude,l/r),d=o.height-(o.height-a.height)*(l/r);s.push(i.Cartesian3.fromRadians(h,c,d))}return s}async _onDrawStop(e){let t=this._positions.filter((s,o)=>o!==1),r=await this._onComputedStop(t,this._includeModel);typeof this._callback=="function"&&await this._callback(r)}_stoppedHook(){this._options.onDrawStop&&this._options.onDrawStop(entity)}_onCalc(e){if(e.length>0&&(this._startLabel.position=e[0]),e.length>1){let t=[e[0]];this._resultLabel.position=e[e.length-1];for(let r=0;r<e.length-1;r++)t=t.concat(this._lerp(e[r],e[r+1],this._options.lerpNum));t.push(e[e.length-1]),this._getSampledHeight(t,this._includeModel).then(([r,s])=>(this._includeModel||(this._positions=r),r.map((o,a)=>i.Cartesian3.fromDegrees(i.Math.toDegrees(o.longitude),i.Math.toDegrees(o.latitude),Math.max(o.height||0,s[a]?i.Cartographic.fromCartesian(s[a]).height:0))))).then(r=>{this._includeModel&&(this._positions=r);let s=0;for(let o=0;o<r.length-1;o++){let a=i.Cartesian3.distance(r[o],r[o+1]);s+=a}this._resultLabel.label.text=s>1e3?`\u8DDD\u79BB\uFF1A${(s/1e3).toFixed(2)} \u516C\u91CC`:`\u8DDD\u79BB\uFF1A${s.toFixed(2)} \u7C73`})}}start(e,t,r={}){return this._startHook(e,r),new Ad({material:r.material||i.Color.YELLOW.withAlpha(.6),depthFailMaterial:r.depthFailMaterial||new i.PolylineDashMaterialProperty({color:i.Color.YELLOW.withAlpha(.6)}),width:r.width||2,clampToGround:!0}).start(e,{...this._options,maxAnchorSize:this._maxAnchorSize}),this._includeModel=r==null?void 0:r.includeModel,this._callback=t,this}},Ld=Da;var La=class{constructor(e){if(!e)throw Error("missing viewer param");this._viewer=e,this._layer=new i.CustomDataSource("plotAnalysis-layer"),this._viewer.dataSources.add(this._layer)}get viewer(){return this._viewer}get layer(){return this._layer}profile(e,t={}){var r;return(r=new Ld)==null||r.start(this,e,t),this}activate(e,t){switch(e){case ei.PROFILE:this.profile(t);break;default:break}return this}deactivate(){return this._layer.entities.removeAll(),this._viewer.drawTool.tooltipMess="",this._viewer.drawTool.deactivate(),this._viewer.editTool.tooltipMess="",this._viewer.editTool.deactivate(),this}},Rd=La;var Ra=class{static init(){let e=me("turf");if(!e)throw new Error("miss the turf lib");return e}static pointBuffer(e,t=50,r=8){let s=this.init(),o=_.parsePosition(e),a=s.point([o.lng,o.lat,o.alt]),l=s.buffer(a,t,{units:"meters",steps:r}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static polylineBuffer(e,t=50,r=8){let s=this.init(),a=_.parsePositions(e).map(d=>[d.lng,d.lat,d.alt]),l=s.lineString(a),h=s.buffer(l,t,{units:"meters",steps:r}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static polygonBuffer(e,t=50,r=8){let s=this.init(),o=_.parsePositions(e),a=o.concat(o[0]).map(d=>[d.lng,d.lat,d.alt]),l=s.polygon([a]),h=s.buffer(l,t,{units:"meters",steps:r}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static transformPolylineScale(e,t=1){let r=this.init(),o=_.parsePositions(e).map(c=>[c.lng,c.lat,c.alt]),a=r.lineString(o),l=r.transformScale(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h}static transformPolygonScale(e,t){let r=this.init(),s=_.parsePositions(e),o=s.concat(s[0]).map(c=>[c.lng,c.lat,c.alt]),a=r.polygon([o]),l=r.transformScale(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static transformPolylineRotate(e,t=0){let r=this.init(),o=_.parsePositions(e).map(c=>[c.lng,c.lat,c.alt]),a=r.lineString(o),l=r.transformRotate(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h}static transformPolygonRotate(e,t=0){let r=this.init(),s=_.parsePositions(e),o=s.concat(s[0]).map(c=>[c.lng,c.lat,c.alt]),a=r.polygon([o]),l=r.transformRotate(a,t,{units:"meters"}),{coordinates:h}=l.geometry;return h&&h.length>0?h[0]:[]}static sector(e,t,r,s){let o=this.init(),a=_.parsePosition(e),l=o.point([a.lng,a.lat,a.alt]),h=o.sector(l,t,r,s,{units:"meters"}),{coordinates:c}=h.geometry;return c&&c.length>0?c[0]:[]}static polygonEquivalent(e,t,r,s=null){let o=this.init(),a=[];for(let d=0,f=e.length;d<f;d++){let T=e[d];a.push({type:"Feature",properties:T,geometry:{type:"Point",coordinates:[T.x,T.y]}})}let l={type:"FeatureCollection",features:a};s&&s!==null&&(l=o.interpolate(l,s.cellSize||10,{gridType:"point",property:r,units:(s==null?void 0:s.units)||"kilometers",weight:(s==null?void 0:s.weight)||1}),l.features.map(d=>d.properties[r]=Number(d.properties[r].toFixed(2))));let h=o.isobands(l,t,{zProperty:r}),c=o.isolines(l,t,{zProperty:r});return{geojsonPoly:h,geojsonLine:c}}},Od=Ra;var n9=i.Cartesian2,l9=i.Cartesian3,h9=i.Matrix3,c9=i.Matrix4,d9=i.Material,p9=i.SceneMode,m9=i.SkyBox,u9=i.Color,_9=i.Rectangle,f9=i.ShadowMode,g9=i.JulianDate,y9=i.HeightReference,v9=i.HorizontalOrigin,w9=i.VerticalOrigin,T9=i.CallbackProperty,C9=i.ClassificationType,x9=i.Cesium3DTileStyle,E9=i.GeographicTilingScheme,P9=i.WebMercatorTilingScheme,b9=i.ColorMaterialProperty,S9=i.ImageMaterialProperty,I9=i.PolylineDashMaterialProperty,M9=i.PolylineGlowMaterialProperty,A9=i.PolylineOutlineMaterialProperty,D9=i.PolylineArrowMaterialProperty,L9=i.writeTextToCanvas,R9=i.CustomShaderMode,O9=i.CustomShaderTranslucencyMode,k9=i.CustomShader,F9=i.UniformType,z9=i.Ellipsoid,H9=i.Resource,N9=i.createGooglePhotorealistic3DTileset,W9=i.createElevationBandMaterial,G9=i.ModelAnimationLoop,U9=i.ClippingPlane,B9=i.ClippingPlaneCollection,V9=i.ClippingPolygon,j9=i.ClippingPolygonCollection;var Iu="./libs/gm-sdk/resources/",kd=Iu,Fd=!1,X9={set baseUrl(n){kd=n},get baseUrl(){return kd}};function J9(n={}){return Fd?Promise.resolve():(zd&&zd(),new Promise((e,t)=>{n.baseUrl&&(this.config.baseUrl=n.baseUrl),n.echarts&&(Xn(n.echarts),pe("echarts",n.echarts)),n.turf&&pe("turf",n.turf),n.shpUtil&&pe("shpUtil",n.shpUtil),Fd=!0,$e("isInitialized",!0),$e("baseUrl",this.config.baseUrl),e()}).catch(e=>{throw new Error(e.message)}))}function zd(){console.clear(),console.log(`%c
1750
1750
  GM-SDK %c %c
1751
1751
 
1752
- \u7248\u672C: 1.12.1 - 2025-02-08
1753
- \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")}var K9="1.12.1";export{Id as Analysis,$t as AnalysisType,V as AnimationType,Nc as AroundPoint,Hc as AroundView,ke as AttackArrow,Ce as Billboard,ht as BillboardPrimitive,ln as BounceBillboardPrimitive,cn as BounceLabelPrimitive,bn as Box,T9 as CallbackProperty,n9 as Cartesian2,l9 as Cartesian3,Yn as ChartLayer,dt as Circle,Bh as CircleBlurMaterialProperty,Vh as CircleDiffuseMaterialProperty,jh as CircleFadeMaterialProperty,Yh as CirclePulseMaterialProperty,Gc as CircleScan,Zh as CircleScanMaterialProperty,qh as CircleSpiralMaterialProperty,Xh as CircleVaryMaterialProperty,Jh as CircleWaveMaterialProperty,C9 as ClassificationType,U9 as ClippingPlane,B9 as ClippingPlaneCollection,V9 as ClippingPolygon,j9 as ClippingPolygonCollection,dn as CloudPrimitive,Ya as ClusterLayer,u9 as Color,b9 as ColorMaterialProperty,ce as CoordTransform,Sn as Corridor,Ja as CustomBillboard,ql as CustomGeographicTilingScheme,Ka as CustomLabel,Xl as CustomMercatorTilingScheme,k9 as CustomShader,R9 as CustomShaderMode,O9 as CustomShaderTranslucencyMode,In as Cylinder,Za as CzmlLayer,pn as DiffuseWallPrimitive,tn as DivIcon,S as DomUtil,ot as DoubleArrow,Qa as DynamicBillboard,qa as DynamicLayer,$a as DynamicModel,fu as Effect,mn as ElecEllipsoidPrimitive,Mn as Ellipse,z9 as Ellipsoid,Kh as EllipsoidElectricMaterialProperty,Qh as EllipsoidTrailMaterialProperty,Xa as FeatureGridLayer,at as FineArrow,un as FlowLinePrimitive,Uc as Flying,nt as GatheringPlace,_t as GeoJsonLayer,Od as GeoTools,E9 as GeographicTilingScheme,Bc as GlobeRotate,Fn as GpxLayer,zn as GraticuleLayer,Hn as GroundPrimitiveLayer,ul as GroundSkyBox,lm as HeatMapLayer,y9 as HeightReference,v9 as HorizontalOrigin,Nn as HtmlLayer,rn as I3S,Wn as I3SLayer,S9 as ImageMaterialProperty,Zl as ImageryLayerFactory,R as ImageryType,g9 as JulianDate,nd as KeyboardRoaming,Gn as KmlLayer,pt as Label,Un as LabelLayer,ct as LabelPrimitive,P as Layer,Ua as LayerGroup,Be as LayerType,fn as LightCylinderPrimitive,d9 as Material,en as Math,h9 as Matrix3,c9 as Matrix4,Td as Measure,se as MeasureType,Oe as Model,G9 as ModelAnimationLoop,Ae as ModelEventType,gn as ModelPrimitive,L as MouseEventType,Pe as MouseMode,g as Overlay,F as OverlayType,_ as P,_ as Parse,Dn as Plane,pu as Plot,Rd as PlotAnalysis,ei as PlotAnalysisType,mt as Point,vn as PointPrimitive,xe as Polygon,Ee as Polyline,D9 as PolylineArrowMaterialProperty,I9 as PolylineDashMaterialProperty,$h as PolylineFlickerMaterialProperty,ec as PolylineFlowMaterialProperty,M9 as PolylineGlowMaterialProperty,tc as PolylineImageTrailMaterialProperty,ic as PolylineLightingMaterialProperty,rc as PolylineLightingTrailMaterialProperty,A9 as PolylineOutlineMaterialProperty,wn as PolylinePrimitive,sc as PolylineTrailMaterialProperty,Rn as PolylineVolume,Y as Position,Bn as PrimitiveLayer,oc as RadarLineMaterialProperty,jc as RadarScan,ac as RadarSweepMaterialProperty,nc as RadarWaveMaterialProperty,Vn as RasterTileLayer,ut as Rect,_9 as Rectangle,Pn as ReflectionWaterPrimitive,H9 as Resource,ld as RoamingController,hd as RoamingPath,Tn as ScanCirclePrimitive,A as SceneEventType,p9 as SceneMode,f9 as ShadowMode,kn as Shp2JsonLayer,m9 as SkyBox,An as Sphere,u as T,lt as TailedAttackArrow,Jl as TerrainFactory,Se as TerrainType,q as TileSetEventType,sn as Tileset,jn as TilesetLayer,x9 as TilesetStyle,dd as Track,cd as TrackController,Ie as TrackViewMode,Cn as TrailLinePrimitive,u as Transform,F9 as UniformType,v as Util,K9 as VERSION,de as VectorLayer,w9 as VerticalOrigin,xn as VideoPrimitive,Xp as Viewer,On as Wall,lc as WallImageTrailMaterialProperty,cc as WallLineTrailMaterialProperty,pc as WallTrailMaterialProperty,mc as WaterMaterialProperty,En as WaterPrimitive,Tu as Weather,cm as WindLayer,X9 as config,W9 as createElevationBandMaterial,N9 as createGooglePhotorealistic3DTileset,P9 as ebMercatorTilingScheme,me as getLib,J9 as ready,pe as registerLib,L9 as writeTextToCanvas};
1752
+ \u7248\u672C: 1.12.2 - 2025-02-08
1753
+ \u7F51\u7AD9\u4E3B\u9875: http://127.0.0.1:8081/greatmap/gm-docs/zh/index.html`,"font-size:20px;padding-left:70px;color:#EEB422","font-size:14px;padding-left:50px;color:#EEB422;font-style:oblique","font-size:12px;color:#0865ba")}var K9="1.12.2";export{Id as Analysis,$t as AnalysisType,V as AnimationType,Nc as AroundPoint,Hc as AroundView,ke as AttackArrow,Ce as Billboard,ht as BillboardPrimitive,ln as BounceBillboardPrimitive,cn as BounceLabelPrimitive,bn as Box,T9 as CallbackProperty,n9 as Cartesian2,l9 as Cartesian3,Yn as ChartLayer,dt as Circle,Bh as CircleBlurMaterialProperty,Vh as CircleDiffuseMaterialProperty,jh as CircleFadeMaterialProperty,Yh as CirclePulseMaterialProperty,Gc as CircleScan,Zh as CircleScanMaterialProperty,qh as CircleSpiralMaterialProperty,Xh as CircleVaryMaterialProperty,Jh as CircleWaveMaterialProperty,C9 as ClassificationType,U9 as ClippingPlane,B9 as ClippingPlaneCollection,V9 as ClippingPolygon,j9 as ClippingPolygonCollection,dn as CloudPrimitive,Ya as ClusterLayer,u9 as Color,b9 as ColorMaterialProperty,ce as CoordTransform,Sn as Corridor,Ja as CustomBillboard,ql as CustomGeographicTilingScheme,Ka as CustomLabel,Xl as CustomMercatorTilingScheme,k9 as CustomShader,R9 as CustomShaderMode,O9 as CustomShaderTranslucencyMode,In as Cylinder,Za as CzmlLayer,pn as DiffuseWallPrimitive,tn as DivIcon,S as DomUtil,ot as DoubleArrow,Qa as DynamicBillboard,qa as DynamicLayer,$a as DynamicModel,fu as Effect,mn as ElecEllipsoidPrimitive,Mn as Ellipse,z9 as Ellipsoid,Kh as EllipsoidElectricMaterialProperty,Qh as EllipsoidTrailMaterialProperty,Xa as FeatureGridLayer,at as FineArrow,un as FlowLinePrimitive,Uc as Flying,nt as GatheringPlace,_t as GeoJsonLayer,Od as GeoTools,E9 as GeographicTilingScheme,Bc as GlobeRotate,Fn as GpxLayer,zn as GraticuleLayer,Hn as GroundPrimitiveLayer,ul as GroundSkyBox,lm as HeatMapLayer,y9 as HeightReference,v9 as HorizontalOrigin,Nn as HtmlLayer,rn as I3S,Wn as I3SLayer,S9 as ImageMaterialProperty,Zl as ImageryLayerFactory,R as ImageryType,g9 as JulianDate,nd as KeyboardRoaming,Gn as KmlLayer,pt as Label,Un as LabelLayer,ct as LabelPrimitive,P as Layer,Ua as LayerGroup,Be as LayerType,fn as LightCylinderPrimitive,d9 as Material,en as Math,h9 as Matrix3,c9 as Matrix4,Td as Measure,se as MeasureType,Oe as Model,G9 as ModelAnimationLoop,Ae as ModelEventType,gn as ModelPrimitive,L as MouseEventType,Pe as MouseMode,g as Overlay,F as OverlayType,_ as P,_ as Parse,Dn as Plane,pu as Plot,Rd as PlotAnalysis,ei as PlotAnalysisType,mt as Point,vn as PointPrimitive,xe as Polygon,Ee as Polyline,D9 as PolylineArrowMaterialProperty,I9 as PolylineDashMaterialProperty,$h as PolylineFlickerMaterialProperty,ec as PolylineFlowMaterialProperty,M9 as PolylineGlowMaterialProperty,tc as PolylineImageTrailMaterialProperty,ic as PolylineLightingMaterialProperty,rc as PolylineLightingTrailMaterialProperty,A9 as PolylineOutlineMaterialProperty,wn as PolylinePrimitive,sc as PolylineTrailMaterialProperty,Rn as PolylineVolume,Y as Position,Bn as PrimitiveLayer,oc as RadarLineMaterialProperty,jc as RadarScan,ac as RadarSweepMaterialProperty,nc as RadarWaveMaterialProperty,Vn as RasterTileLayer,ut as Rect,_9 as Rectangle,Pn as ReflectionWaterPrimitive,H9 as Resource,ld as RoamingController,hd as RoamingPath,Tn as ScanCirclePrimitive,A as SceneEventType,p9 as SceneMode,f9 as ShadowMode,kn as Shp2JsonLayer,m9 as SkyBox,An as Sphere,u as T,lt as TailedAttackArrow,Jl as TerrainFactory,Se as TerrainType,q as TileSetEventType,sn as Tileset,jn as TilesetLayer,x9 as TilesetStyle,dd as Track,cd as TrackController,Ie as TrackViewMode,Cn as TrailLinePrimitive,u as Transform,F9 as UniformType,v as Util,K9 as VERSION,de as VectorLayer,w9 as VerticalOrigin,xn as VideoPrimitive,Xp as Viewer,On as Wall,lc as WallImageTrailMaterialProperty,cc as WallLineTrailMaterialProperty,pc as WallTrailMaterialProperty,mc as WaterMaterialProperty,En as WaterPrimitive,Tu as Weather,cm as WindLayer,X9 as config,W9 as createElevationBandMaterial,N9 as createGooglePhotorealistic3DTileset,P9 as ebMercatorTilingScheme,me as getLib,J9 as ready,pe as registerLib,L9 as writeTextToCanvas};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmgis/gm-sdk",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "license": "MIT",
5
5
  "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.",
6
6
  "repository": "http://gitlab.greatmap.com.cn:10000/gmgis/gm-sdk.git",