@anov/gis 1.6.0 → 1.6.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 +13 -12
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/resources/static/images/modelicon.png +0 -0
- package/dist/resources/static/images/wall1.png +0 -0
- package/dist/resources/static/images/wall2.png +0 -0
- package/dist/resources/static/images/wallline.png +0 -0
- package/dist/resources/static/images/walltest.png +0 -0
- package/package.json +12 -7
- package/packages/applyfn/dist/applyfn.js +1 -1
- package/packages/applyfn/dist/resources/static/images/modelicon.png +0 -0
- package/packages/applyfn/dist/resources/static/images/wall1.png +0 -0
- package/packages/applyfn/dist/resources/static/images/wall2.png +0 -0
- package/packages/applyfn/dist/resources/static/images/wallline.png +0 -0
- package/packages/applyfn/dist/resources/static/images/walltest.png +0 -0
- package/packages/ui/dist/demo.html +10 -0
- package/packages/ui/dist/ui.common.js +2513 -0
- package/packages/ui/dist/ui.css +1 -0
- package/packages/ui/dist/ui.umd.js +2523 -0
- package/packages/ui/dist/ui.umd.min.js +1 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/gis",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "基于Cesium封装的二次开发SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "http://172.16.222.31:8866",
|
|
@@ -14,14 +14,19 @@
|
|
|
14
14
|
"pdoc": "npm run docs:dev",
|
|
15
15
|
"copy_css_dev": "ncp src/themes node_modules/cesium/Build/CesiumUnminified/as_css",
|
|
16
16
|
"copy_css": "ncp src/themes node_modules/cesium/Build/Cesium/as_css",
|
|
17
|
-
"test": "cd ./examples && yarn dev",
|
|
18
|
-
"test2": "cd ./examples && yarn dev2",
|
|
19
|
-
"serve": "cd ./examples && yarn serve",
|
|
20
|
-
"
|
|
17
|
+
"test": "npm run copydeployConfig && cd ./examples && yarn dev",
|
|
18
|
+
"test2": "npm run copydeployConfig && cd ./examples && yarn dev2",
|
|
19
|
+
"serve": "npm run copydeployConfig && cd ./examples && yarn serve",
|
|
20
|
+
"copydeployConfig": "rimraf ./config/deployConfig.js && ncp ./config/config_nei.js ./config/deployConfig.js",
|
|
21
|
+
"copydeployConfigwai": "rimraf ./config/deployConfig.js && ncp ./config/config_wai.js ./config/deployConfig.js",
|
|
22
|
+
"buildexample": "npm run copydeployConfig && cd ./examples && yarn build",
|
|
23
|
+
"buildexamplewai": "npm run copydeployConfigwai && cd ./examples && yarn build",
|
|
21
24
|
"docs:dev": "vuepress dev docs",
|
|
22
25
|
"docs:build": "vuepress build docs",
|
|
23
26
|
"dev:applyfn": "webpack --config config/webpack.config.applyfn.js --mode development",
|
|
24
|
-
"build:applyfn": "cross-env NODE_ENV=production webpack --config config/webpack.config.applyfn.js --mode production"
|
|
27
|
+
"build:applyfn": "cross-env NODE_ENV=production webpack --config config/webpack.config.applyfn.js --mode production",
|
|
28
|
+
"dev:ui": "webpack --config config/webpack.config.ui.js --mode development",
|
|
29
|
+
"build:ui": "cross-env NODE_ENV=production webpack --config config/webpack.config.ui.js --mode production"
|
|
25
30
|
},
|
|
26
31
|
"repository": {
|
|
27
32
|
"type": "git",
|
|
@@ -75,4 +80,4 @@
|
|
|
75
80
|
"yarn": "^1.22.19"
|
|
76
81
|
},
|
|
77
82
|
"dependencies": {}
|
|
78
|
-
}
|
|
83
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("anovgis_applyfn",[],r):"object"==typeof exports?exports.anovgis_applyfn=r():e.anovgis_applyfn=r()}(self,(()=>(()=>{"use strict";var e={879:(e,r,t)=>{function i(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var r=function(e,r){if("object"!==o(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(r)?r:String(r)}function n(e,r){for(var t=0;t<r.length;t++){var i=r[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function l(e,r,t){return r&&n(e.prototype,r),t&&n(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}t.d(r,{Z:()=>O});const s=function(){function e(){i(this,e),this._imageLayer=null,this._vectorLayer=null,this._terrianLayer=null,this._labelMarkLayer=null,this._imageLayer_gd=null,this._vectorLayer_gd=null,this._labelMarkLayer_gd=null,this._imageLayer_bd=null,this._vectorLayer_bd=null,this._labelMarkLayer_bd=null}return l(e,null,[{key:"addWorldLayer",value:function(e){e.key||(e.key="b832b9764939cbb0919148c548b669ba"),0==e.type&&(this._imageLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createImageryLayer(ANOVGIS.ImageryType.TDT,{style:"img",key:worldOption.key}))),1==e.type&&(this._vectorLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createTdtImageryLayer({key:e.key}))),2==e.type&&(this._terrianLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createTdtImageryLayer({style:"ter",key:e.key}))),this._labelMarkLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createImageryLayer(ANOVGIS.ImageryType.TDT,{style:"cva",key:e.key}))}},{key:"setWorldLayer",value:function(e,r){0==e&&this._imageLayer&&(this._imageLayer.show=r),1==e&&this._vectorLayer&&(this._vectorLayer.show=r),2==e&&this._terrianLayer&&(this._terrianLayer.show=r)}},{key:"setWorldMark",value:function(e){this._labelMarkLayer&&(this._labelMarkLayer.show=e)}},{key:"addAmapLayer",value:function(e){e.key||(e.key="9d167bfcf179354f55833ee5603c2423"),0==e.type&&(this._imageLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({style:"img",crs:"WGS84"}))),1==e.type&&(this._vectorLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({crs:"WGS84"}))),this._labelMarkLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({style:"cva",crs:"WGS84"}))}},{key:"setAmapLayer",value:function(e,r){0==e&&this._imageLayer&&(this._imageLayer_bd.show=r),1==e&&this._vectorLayer&&(this._vectorLayer_bd.show=r)}},{key:"setAmapMaker",value:function(e){this._labelMarkLayer_bd&&(this.this._labelMarkLayer_bd.show=e)}},{key:"addBmapLayer",value:function(e){0==e.type&&(this._imageLayer_bd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createBaiduImageryLayer({style:"img",crs:"WGS84"}))),1==e.type&&(this._vectorLayer_bd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createBaiduImageryLayer({crs:"WGS84"})))}}]),e}();function u(e,r,t){var i="",o=r,a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];e&&(o=Math.round(Math.random()*(t-r))+r);for(var n=0;n<o;n++)i+=a[Math.round(Math.random()*(a.length-1))];return i}function y(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return n=e.done,e},e:function(e){l=!0,a=e},f:function(){try{n||null==t.return||t.return()}finally{if(l)throw a}}}}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function f(e,r){var t,i=null,o=y(r.viewer.dataSources.getByName(r.roofDSName)[0].entities.values);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(a.name==e){i=a;break}}}catch(e){o.e(e)}finally{o.f()}return i}function d(e,r){var t,i=null,o=y(r.viewer.entities.values);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(a.id==e){i=a;break}}}catch(e){o.e(e)}finally{o.f()}return i}function m(e,r,t){var i=0;if(0==r.showType)i=e<=6?0:e>6&&e<=80?1:2;else{var o,a=!1,n=y(r.keyInfoList);try{for(n.s();!(o=n.n()).done;){var l=o.value,s=h(l.keyPosition,t,l.f_range,0);if(a=h(l.keyPosition,t,l.s_range,0),s)return 2}}catch(e){n.e(e)}finally{n.f()}if(a)return 1}return i}function h(e,r,t,i){var o=!1,a=new ANOVGIS.Position(e[0],e[1]),n=new ANOVGIS.Position(r[0],r[1]);return a.distance(n)<=t+i&&(o=!0),o}function v(e){return e>0&&e<4?8:e>=4&&e<=10?6:3}function g(e){return Array.prototype.concat.apply([],e)}const p=function(){function e(r){i(this,e),this.viewer=r,this.floorHeight=3,this.distanceMax=1e3,this.curBuildRange=100,this.keyRange=30,this.showType=0,this.clickWall=null,this.wallMaterial=null,this.clickRoof=null,this.roofMaterial=null,this.dataIndex=-1,this.roofDSName=null,this.selectEntityId=null,this.useMaterial=!0,this.selectColor="",this.buildInfo={geojsonData:null,buildObj:{color:"rgba(73,137,255,1)",defColor:"#324f7b",keyColor:"rgba(10,231,241,0.5)",isOutline:!1,outlineColor:"rgba(59,179,249,0.1)",useMaterial:!0,selectColor:"rgba(237,175,67,1)"},showInfo:{showType:0,keyInfoList:[{keyPosition:[116.39831273,39.97880908],f_range:30,s_range:1e3}]}}}return l(e,[{key:"addGeojsonBuild",value:function(e,r){var t,i=function(e,r,t){t.useMaterial=e.buildObj.useMaterial,t.selectColor=e.buildObj.selectColor;var i,o={wall:null,geojson:null},a=[],n={type:"FeatureCollection",features:[]},l=y(r.features);try{for(l.s();!(i=l.n()).done;){var s=i.value,c=""+u(!1,10,10);s.properties.buildId=c;var f=s.properties.height-0,d=v(f),h=m(f,e.showInfo,s.geometry.coordinates[0][0]);a.push({buildId:c,wallType:h,height:f*d,coordinates:s.geometry.coordinates[0]}),s.properties.showType=h,n.features.push(s)}}catch(e){l.e(e)}finally{l.f()}return o.wall=a,o.geojson=n,o}(e,r,this);this.addWall(i.wall,e.buildObj,this.viewer),this.addRoof(i.geojson,e.buildObj,this.viewer),t=this,new Cesium.ScreenSpaceEventHandler(t.viewer.scene.canvas).setInputAction((function(e){var r=t.viewer.scene.pick(e.position);console.log("position",e.position),console.log("position",Cesium.Cartographic.fromCartesian(e.position));var i=t.viewer.scene.globe.pick(t.viewer.camera.getPickRay(e.position),t.viewer.scene),o=t.viewer.scene.globe.ellipsoid.cartesianToCartographic(i),a=Cesium.Math.toDegrees(o.longitude),n=Cesium.Math.toDegrees(o.latitude);if(console.log("坐标",[a,n]),r&&r.id){var l=null;r.id.wall&&(l=r.id.id),r.id.polygon&&(l=r.id.name),function(e,r){(function(e){if(e.selectEntityId){var r=e.selectEntityId,t=d("wall_"+r,e);console.log("setPreMaterial",t);var i=f("roof_"+r,e);console.log("setPreMaterial",i),t.wall.material=e.wallMaterial,i.polygon.material=e.roofMaterial}})(r),e?function(e,r){var t=e.replace("wall_","").replace("roof_",""),i=d("wall_"+t,r);console.log("setCurMaterial",i);var o=f("roof_"+t,r);console.log("setCurMaterial",o),r.wallMaterial=i.wall.material,r.roofMaterial=o.polygon.material,r.useMaterial?i.wall.material=new ANOVGIS.WallFlowMaterialProperty({color:Cesium.Color.fromCssColorString(r.selectColor),duration:2600}):i.wall.material=new ANOVGIS.WallGradientMaterialProperty({color:Cesium.Color.fromCssColorString(r.selectColor),duration:2500}),o.polygon.material=Cesium.Color.fromCssColorString(r.selectColor),r.selectEntityId=t}(e,r):console.log("没有找到entityId!")}(l,t),console.log("点击建筑的id:",r.id)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"addWall",value:function(e,r,t){var i,o=y(e);try{for(o.s();!(i=o.n()).done;){var a=i.value,n=g(a.coordinates),l={id:"wall_"+a.buildId,wall:{outline:r.isOutline,outlineColor:Cesium.Color.fromCssColorString(r.outlineColor),positions:Cesium.Cartesian3.fromDegreesArray(n),maximumHeights:new Array(a.coordinates.length).fill(a.height),minimumHeights:new Array(a.coordinates.length).fill(0)}};0==a.wallType?(l.wall.outline=!1,l.wall.material=Cesium.Color.fromCssColorString(r.defColor)):2==a.wallType?l.wall.material=new ANOVGIS.WallFlowMaterialProperty({color:Cesium.Color.fromCssColorString(r.keyColor),duration:2600}):l.wall.material=new ANOVGIS.WallGradientMaterialProperty({color:Cesium.Color.fromCssColorString(r.color),duration:2500}),t.entities.add(l)}}catch(e){o.e(e)}finally{o.f()}}},{key:"addRoof",value:function(e,r,t){var i=this;Cesium.GeoJsonDataSource.load(e).then((function(e){e.name=r.name+"-DS",i.roofDSName=e.name,t.dataSources.add(e);var o,a=y(e.entities.values);try{for(a.s();!(o=a.n()).done;){var n=o.value,l=n.properties.buildId.getValue();n.name="roof_"+l;var s=n.properties.height.getValue()-0,u=n.properties.showType.getValue()-0;n.polygon.height=s*v(s),0==u&&(n.polygon.material=Cesium.Color.fromCssColorString(r.defColor)),1==u&&(n.polygon.material=Cesium.Color.fromCssColorString(r.color)),2==u&&(n.polygon.material=Cesium.Color.fromCssColorString(r.keyColor)),n.polygon.outline=r.isOutline,r.isOutline&&(n.polygon.outlineColor=Cesium.Color.fromCssColorString(r.outlineColor))}}catch(e){a.e(e)}finally{a.f()}}))}}]),e}();function w(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return C(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return n=e.done,e},e:function(e){l=!0,a=e},f:function(){try{n||null==t.return||t.return()}finally{if(l)throw a}}}}function C(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function b(e){return e+u(!1,10,10)}function I(e,r){return r.entities.getById(e)}const L=function(){function e(r){i(this,e),this.viewer=r,this.rangeKey=.02,this.circleWaveOption={id:"circlewave1",position:[116.397428,39.90923,0],maxRadius:800,duration:3e3,color:"rgba(59,179,249,0.7)",count:4},this.raderOption={position:[116.397428,39.90923],radius:500,colorType:0,outline:!1,speed:-1.5},this.FlywireOption={position:[116.397428,39.90923],height:1e4,speed:8,color:"rgba(63,140,255,0.8)",num:500,density:.02},this.vfwIdList=[],this.flowLightLineOp={geojson:"",width:8,color:"rgba(255,255,0,0.5)",speed:8}}return l(e,[{key:"createCircleWave",value:function(e){var r=b("cw_"),t={id:r,position:Cesium.Cartesian3.fromDegrees(e.position[0],e.position[1],e.position[2]),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(r){return e.maxRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(r){return e.maxRadius}),!1),material:new ANOVGIS.CircleWaveMaterialProperty({duration:e.duration,gradient:.5,color:new Cesium.Color.fromCssColorString(e.color),count:e.count})}};return this.viewer.entities.add(t),r}},{key:"deleteEffect",value:function(e){var r=I(e,this.viewer);this.viewer.entities.remove(r)}},{key:"showEffect",value:function(e,r){I(e,this.viewer).show=r}},{key:"addRader",value:function(e){var r=b("rd_"),t=Cesium.buildModuleUrl("static/images/rader-g.png"),i=Cesium.Color.fromCssColorString("rgba(36,229,104,0.7)");1==e.colorType&&(t=Cesium.buildModuleUrl("static/images/rader-y.png"),i=Cesium.Color.fromCssColorString("rgba(229, 225, 36 , 0.8)")),2==e.colorType&&(t=Cesium.buildModuleUrl("static/images/rader-r.png"),i=Cesium.Color.fromCssColorString("rgba(229, 225, 36 , 0.8)"));var o,a,n,l={position:Cesium.Cartesian3.fromDegrees(e.position[0],e.position[1]),name:"图片雷达",ellipse:{semiMajorAxis:e.radius,semiMinorAxis:e.radius,material:new Cesium.ImageMaterialProperty({image:t,color:i}),height:20,heightReference:Cesium.HeightReference.RELATIVE_TO_GROUND,outline:e.outline,outlineWidth:5,outlineColor:i}};return o=this.viewer.entities.add(l).ellipse,a=0,n=e.speed,o.stRotation=new Cesium.CallbackProperty((function(){return((a+=n)>=360||a<=-360)&&(a=0),Cesium.Math.toRadians(a)}),!1),r}},{key:"addVerFlywire",value:function(e){if(this.vfwIdList&&this.vfwIdList.length>0){var r,t=w(this.vfwIdList);try{for(t.s();!(r=t.n()).done;){var i=r.value;this.deleteEffect(i,this.viewer)}}catch(e){t.e(e)}finally{t.f()}this.vfwIdList=[]}var o,a=w(function(e,r,t){for(var i=[],o=0;o<4;o++)for(var a=0;a<r;a++)if(0!=o)if(1!=o)if(2!=o){if(3==o){var n=e[0]+Math.random()*t,l=e[1]-Math.random()*t;i.push([n,l])}}else{var s=e[0]+Math.random()*t,u=e[1]+Math.random()*t;i.push([s,u])}else{var y=e[0]-Math.random()*t,c=e[1]-Math.random()*t;i.push([y,c])}else{var f=e[0]-Math.random()*t,d=e[1]+Math.random()*t;i.push([f,d])}return i}(e.position,e.num,e.density));try{for(a.s();!(o=a.n()).done;){var n=o.value,l=n[0],s=n[1],u=new Cesium.Cartesian3.fromDegrees(l,s,0),y=Math.round(Math.random()*e.height),c=new Cesium.Cartesian3.fromDegrees(l,s,y),f=[];f.push(u),f.push(c);var d=b("vfw_");this.viewer.entities.add({id:d,polyline:{positions:f,width:1.5,material:new ANOVGIS.PolylineVFlywireMaterialPoperty({color:Cesium.Color.fromCssColorString(e.color),speed:Math.round(Math.random()*e.speed),percent:.1,gradient:.01})}}),this.vfwIdList.push(d)}}catch(e){a.e(e)}finally{a.f()}}},{key:"deleteVerFlywire",value:function(){if(this.vfwIdList&&this.vfwIdList.length>0){var e,r=w(this.vfwIdList);try{for(r.s();!(e=r.n()).done;){var t=e.value;this.deleteEffect(t)}}catch(e){r.e(e)}finally{r.f()}this.vfwIdList=[]}}},{key:"showVerFlywire",value:function(e){if(this.vfwIdList&&this.vfwIdList.length>0){var r,t=w(this.vfwIdList);try{for(t.s();!(r=t.n()).done;){var i=r.value;this.showEffect(i,e)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"addFlowLightLine",value:function(e){var r=this,t=b("dsfll_");return Cesium.GeoJsonDataSource.load(e.geojson).then((function(i){i.name=t,r.viewer.dataSources.add(i);var o,a=w(i.entities.values);try{for(a.s();!(o=a.n()).done;){var n=o.value;n.polyline.width=e.width,n.polyline.material=new ANOVGIS.PolylineLightingTrailMaterialProperty({color:Cesium.Color.fromCssColorString(e.color),speed:e.speed})}}catch(e){a.e(e)}finally{a.f()}return t}))}},{key:"deleteFlowLightLine",value:function(e){var r=this.viewer.dataSources.getByName(e);r&&this.viewer.dataSources.remove(r)}}]),e}(),S=function(){function e(r,t){i(this,e),this.viewer=t,this.layerName=r,this.htmlLayer=null,this.option={position:[],height:100,horizontalOrigin:"RIGHT",verticalOrigin:"TOP",offsetX:0,offsetY:0,near:0,nearValue:1,far:1e4,farValue:0,html:"",pointerEvents:!1,extraData:null,winClickHandle:null},this.htmlLayer=function(e,r){var t=new ANOVGIS.HtmlLayer(e);return r.addLayer(t),t}(r,t)}return l(e,[{key:"createInfoWin",value:function(e){var r=new ANOVGIS.DivIcon(new ANOVGIS.Position(e.position[0],e.position[1],e.height),e.html),t={horizontalOrigin:e.horizontalOrigin,verticalOrigin:e.verticalOrigin,offsetX:e.offsetX,offsetY:e.offsetY,pointerEvents:e.pointerEvents,scaleByDistance:{near:e.near,nearValue:e.nearValue,far:e.far,farValue:e.farValue}};r.setOptions(t);var i=e.extraData;e.pointerEvents&&"function"==typeof e.winClickHandle&&r.addEventListener(ANOVGIS.MouseEventType.CLICK,(function(){e.winClickHandle(i)})),this.htmlLayer.addGraphic(r)}}]),e}();var _,k,M=function(){function e(){i(this,e)}return l(e,null,[{key:"addWorldLayer",value:function(e){s.addWorldLayer(e)}},{key:"setWorldLayer",value:function(e,r){s.addWorldLayer(e,r)}},{key:"addGeojsonBuild",value:function(e,r,t){new p(t).addGeojsonBuild(e,r)}},{key:"createMapEffect",value:function(e){return new L(e)}},{key:"createInfoWin",value:function(e,r){return new S(e,r)}}]),e}();_=M,(k=a(k="effectObj"))in _?Object.defineProperty(_,k,{value:null,enumerable:!0,configurable:!0,writable:!0}):_[k]=null;const O={ApplyApi:M}}},r={};function t(i){var o=r[i];if(void 0!==o)return o.exports;var a=r[i]={exports:{}};return e[i](a,a.exports,t),a.exports}t.d=(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{t.r(i),t.d(i,{default:()=>r});var e=function(e){if(!e)throw new Error("Missing ANOVGIS Package");e.Initialized_applyfn||(e.initEnvironment(),e.Initialized&&e.mixin(t(879).Z),e.Initialized_applyfn=!0)};"undefined"!=typeof window&&window.ANOVGIS&&e(window.ANOVGIS);const r={version:"1.0.1",author:"huj75@chinaunicom.cn",install:e}})(),i})()));
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("anovgis_applyfn",[],r):"object"==typeof exports?exports.anovgis_applyfn=r():e.anovgis_applyfn=r()}(self,(()=>(()=>{"use strict";var e={274:(e,r,i)=>{function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){var r=function(e,r){if("object"!==o(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var t=i.call(e,"string");if("object"!==o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===o(r)?r:String(r)}function n(e,r){for(var i=0;i<r.length;i++){var t=r[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,a(t.key),t)}}function l(e,r,i){return r&&n(e.prototype,r),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}i.d(r,{Z:()=>G});const s=function(){function e(){t(this,e),this._imageLayer=null,this._vectorLayer=null,this._terrianLayer=null,this._labelMarkLayer=null,this._imageLayer_gd=null,this._vectorLayer_gd=null,this._labelMarkLayer_gd=null,this._imageLayer_bd=null,this._vectorLayer_bd=null,this._labelMarkLayer_bd=null}return l(e,null,[{key:"addWorldLayer",value:function(e){e.key||(e.key="b832b9764939cbb0919148c548b669ba"),0==e.type&&(this._imageLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createImageryLayer(ANOVGIS.ImageryType.TDT,{style:"img",key:e.key}))),1==e.type&&(this._vectorLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createTdtImageryLayer({key:e.key}))),2==e.type&&(this._terrianLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createTdtImageryLayer({style:"ter",key:e.key}))),this._labelMarkLayer=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createImageryLayer(ANOVGIS.ImageryType.TDT,{style:"cva",key:e.key}))}},{key:"setWorldLayer",value:function(e,r){0==e&&this._imageLayer&&(this._imageLayer.show=r),1==e&&this._vectorLayer&&(this._vectorLayer.show=r),2==e&&this._terrianLayer&&(this._terrianLayer.show=r)}},{key:"setWorldMark",value:function(e){this._labelMarkLayer&&(this._labelMarkLayer.show=e)}},{key:"addAmapLayer",value:function(e){e.key||(e.key="9d167bfcf179354f55833ee5603c2423"),0==e.type&&(this._imageLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({style:"img",crs:"WGS84"}))),1==e.type&&(this._vectorLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({crs:"WGS84"}))),this._labelMarkLayer_gd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createAmapImageryLayer({style:"cva",crs:"WGS84"}))}},{key:"setAmapLayer",value:function(e,r){0==e&&this._imageLayer&&(this._imageLayer_bd.show=r),1==e&&this._vectorLayer&&(this._vectorLayer_bd.show=r)}},{key:"setAmapMaker",value:function(e){this._labelMarkLayer_bd&&(this.this._labelMarkLayer_bd.show=e)}},{key:"addBmapLayer",value:function(e){0==e.type&&(this._imageLayer_bd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createBaiduImageryLayer({style:"img",crs:"WGS84"}))),1==e.type&&(this._vectorLayer_bd=e.viewer.imageryLayers.addImageryProvider(ANOVGIS.ImageryLayerFactory.createBaiduImageryLayer({crs:"WGS84"})))}}]),e}();function u(e,r,i){var t="",o=r,a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];e&&(o=Math.round(Math.random()*(i-r))+r);for(var n=0;n<o;n++)t+=a[Math.round(Math.random()*(a.length-1))];return t}function c(e){return Array.prototype.concat.apply([],e)}function d(e,r){return!(!Array.isArray(e)||e.length!=r)}function f(e,r){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,r){if(e){if("string"==typeof e)return y(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?y(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){i&&(e=i);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n=!0,l=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){l=!0,a=e},f:function(){try{n||null==i.return||i.return()}finally{if(l)throw a}}}}function y(e,r){(null==r||r>e.length)&&(r=e.length);for(var i=0,t=new Array(r);i<r;i++)t[i]=e[i];return t}function m(e,r){return r||e||"rgba(105,201,245,0.9)"}function h(e,r,i){var t={wallType:0,color:"",image:""};if(0==r.showType)t.wallType=e<=6?0:e>6&&e<=80?1:2;else{var o,a=!1,n=f(r.keyInfoList);try{for(n.s();!(o=n.n()).done;){var l=o.value;if(g(l.keyPosition,i,l.f_range,0))return l.keyColor&&(t.color=l.keyColor),t.wallType=2,t;a||((a=g(l.keyPosition,i,l.s_range,0))&&l.color&&(t.color=l.color),a&&l.image&&(t.image=l.image))}}catch(e){n.e(e)}finally{n.f()}if(a)return t.wallType=1,t}return t}function g(e,r,i,t){var o=!1,a=new ANOVGIS.Position(e[0],e[1]),n=new ANOVGIS.Position(r[0],r[1]);return a.distance(n)<=i+t&&(o=!0),o}function p(e){return e>0&&e<4?8:e>=4&&e<=10?6:3}function v(e){return Array.prototype.concat.apply([],e)}const C=function(){function e(r){t(this,e),this.viewer=r,this.floorHeight=3,this.distanceMax=1e3,this.curBuildRange=100,this.keyRange=30,this.showType=0,this.clickWall=null,this.wallMaterial=null,this.clickRoof=null,this.roofMaterial=null,this.dataIndex=-1,this.roofDSName=null,this.selectEntityId=null,this.useMaterial=!0,this.selectColor="",this.buildInfo={geojsonData:null,buildObj:{color:"rgba(73,137,255,1)",defColor:"#324f7b",keyColor:"rgba(10,231,241,0.5)",isOutline:!1,outlineColor:"rgba(59,179,249,0.1)",useMaterial:!0,selectColor:"rgba(237,175,67,1)",image:"",brightness:1},showInfo:{showType:0,keyInfoList:[{keyPosition:[116.39831273,39.97880908],f_range:30,s_range:1e3,color:"",keyColor:"rgba(10,231,241,0.5)",image:""}]}}}return l(e,[{key:"addGeojsonBuild",value:function(e,r){var i,t=function(e,r,i){i.useMaterial=e.buildObj.useMaterial,i.selectColor=e.buildObj.selectColor;var t,o={wall:null,geojson:null},a=[],n={type:"FeatureCollection",features:[]},l=f(r.features);try{for(l.s();!(t=l.n()).done;){var s=t.value,c="BW_"+u(!1,10,10);s.properties.buildId=c;var d=s.properties.height-0,y=p(d),m=h(d,e.showInfo,s.geometry.coordinates[0][0]);a.push({buildId:c,wallType:m.wallType,height:d*y,coordinates:s.geometry.coordinates[0],color:m.color,image:m.image}),s.properties.showType=m.wallType,s.properties.color=m.color,n.features.push(s)}}catch(e){l.e(e)}finally{l.f()}return o.wall=a,o.geojson=n,o}(e,r,this);this.addWall(t.wall,e.buildObj,this.viewer),this.addRoof(t.geojson,e.buildObj,this.viewer),i=this,new Cesium.ScreenSpaceEventHandler(i.viewer.scene.canvas).setInputAction((function(e){var r=i.viewer.scene.pick(e.position),t=i.viewer.scene.globe.pick(i.viewer.camera.getPickRay(e.position),i.viewer.scene),o=i.viewer.scene.globe.ellipsoid.cartesianToCartographic(t);Cesium.Math.toDegrees(o.longitude),Cesium.Math.toDegrees(o.latitude),r&&r.id&&(r.id.wall&&r.id.id,r.id.polygon&&r.id.name)}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}},{key:"addWall",value:function(e,r,i){var t,o,a=f(e);try{for(a.s();!(t=a.n()).done;){var n=t.value,l=v(n.coordinates),s={id:"wall_"+n.buildId,wall:{outline:r.isOutline,outlineColor:Cesium.Color.fromCssColorString(r.outlineColor),positions:Cesium.Cartesian3.fromDegreesArray(l),maximumHeights:new Array(n.coordinates.length).fill(n.height),minimumHeights:new Array(n.coordinates.length).fill(0)}};if(0==n.wallType)s.wall.outline=!1,s.wall.material=Cesium.Color.fromCssColorString(r.defColor);else if(2==n.wallType){var u=m(r.keyColor,n.color);s.wall.material=new ANOVGIS.WallFlowMaterialProperty({color:Cesium.Color.fromCssColorString(u),duration:2600,speed:1,rep:1})}else{var c=m(r.color,n.color),d=(o=r.image,n.image||o);s.wall.material=new ANOVGIS.WallImgMaterialProperty({color:Cesium.Color.fromCssColorString(c),image:d,duration:2500,brightness:r.brightness,isTranslucent:!1})}i.entities.add(s)}}catch(e){a.e(e)}finally{a.f()}}},{key:"addRoof",value:function(e,r,i){var t=this;Cesium.GeoJsonDataSource.load(e).then((function(e){e.name=r.name+"-DS",t.roofDSName=e.name,i.dataSources.add(e);var o,a=f(e.entities.values);try{for(a.s();!(o=a.n()).done;){var n=o.value,l=n.properties.buildId.getValue();n.name="roof_"+l;var s=n.properties.height.getValue()-0,u=n.properties.showType.getValue()-0,c=n.properties.color.getValue();if(n.polygon.height=s*p(s),0==u&&(n.polygon.material=Cesium.Color.fromCssColorString(r.defColor)),1==u){var d=m(r.color,c);n.polygon.material=Cesium.Color.fromCssColorString(d)}if(2==u){var y=m(r.keyColor,c);n.polygon.material=Cesium.Color.fromCssColorString(y)}n.polygon.outline=r.isOutline,r.isOutline&&(n.polygon.outlineColor=Cesium.Color.fromCssColorString(r.outlineColor))}}catch(e){a.e(e)}finally{a.f()}}))}}]),e}();function w(e,r){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,r){if(e){if("string"==typeof e)return b(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){i&&(e=i);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n=!0,l=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){l=!0,a=e},f:function(){try{n||null==i.return||i.return()}finally{if(l)throw a}}}}function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var i=0,t=new Array(r);i<r;i++)t[i]=e[i];return t}function S(e){return e+u(!1,10,10)}function L(e,r){return r.entities.getById(e)}const I=function(){function e(r){t(this,e),this.viewer=r,this.rangeKey=.02,this.circleWaveOption={id:"circlewave1",position:[116.397428,39.90923,0],maxRadius:800,duration:3e3,color:"rgba(59,179,249,0.7)",count:4},this.raderOption={position:[116.397428,39.90923],radius:500,colorType:0,outline:!1,speed:-1.5},this.FlywireOption={position:[116.397428,39.90923],height:1e4,speed:8,color:"rgba(63,140,255,0.8)",num:500,density:.02},this.vfwIdList=[],this.flowLightLineOp={geojson:"",width:8,color:"rgba(255,255,0,0.5)",speed:8},this.parabolaOption={id:"lineLayer",parabolas:[{center:[],target:[],lineHeight:1e3,lineWidth:2,lineOpacity:.2,lineLightLength:.1}]},this.wallAreaOption={pointList:[[]],hight:200,color:"",materialType:0},this.roadLight={pointList:[[]],width:15,speed:10,color:""}}return l(e,[{key:"createCircleWave",value:function(e){var r=S("cw_"),i={id:r,position:Cesium.Cartesian3.fromDegrees(e.position[0],e.position[1],e.position[2]),ellipse:{semiMinorAxis:new Cesium.CallbackProperty((function(r){return e.maxRadius}),!1),semiMajorAxis:new Cesium.CallbackProperty((function(r){return e.maxRadius}),!1),material:new ANOVGIS.CircleWaveMaterialProperty({duration:e.duration,gradient:.5,color:new Cesium.Color.fromCssColorString(e.color),count:e.count})}};return this.viewer.entities.add(i),r}},{key:"deleteEffect",value:function(e){var r=L(e,this.viewer);this.viewer.entities.remove(r)}},{key:"showEffect",value:function(e,r){L(e,this.viewer).show=r}},{key:"addRader",value:function(e){var r=S("rd_"),i=Cesium.buildModuleUrl("static/images/rader-g.png"),t=Cesium.Color.fromCssColorString("rgba(36,229,104,0.7)");1==e.colorType&&(i=Cesium.buildModuleUrl("static/images/rader-y.png"),t=Cesium.Color.fromCssColorString("rgba(229, 225, 36, 0.8)")),2==e.colorType&&(i=Cesium.buildModuleUrl("static/images/rader-r.png"),t=Cesium.Color.fromCssColorString("rgba(245,96,42,0.8)"));var o,a,n,l={position:Cesium.Cartesian3.fromDegrees(e.position[0],e.position[1]),name:"图片雷达",ellipse:{semiMajorAxis:e.radius,semiMinorAxis:e.radius,material:new Cesium.ImageMaterialProperty({image:i,color:t}),height:20,heightReference:Cesium.HeightReference.RELATIVE_TO_GROUND,outline:e.outline,outlineWidth:5,outlineColor:t}};return o=this.viewer.entities.add(l).ellipse,a=0,n=e.speed,o.stRotation=new Cesium.CallbackProperty((function(){return((a+=n)>=360||a<=-360)&&(a=0),Cesium.Math.toRadians(a)}),!1),r}},{key:"addVerFlywire",value:function(e){if(this.vfwIdList&&this.vfwIdList.length>0){var r,i=w(this.vfwIdList);try{for(i.s();!(r=i.n()).done;){var t=r.value;this.deleteEffect(t,this.viewer)}}catch(e){i.e(e)}finally{i.f()}this.vfwIdList=[]}var o,a=w(function(e,r,i){for(var t=[],o=0;o<4;o++)for(var a=0;a<r;a++)if(0!=o)if(1!=o)if(2!=o){if(3==o){var n=e[0]+Math.random()*i,l=e[1]-Math.random()*i;t.push([n,l])}}else{var s=e[0]+Math.random()*i,u=e[1]+Math.random()*i;t.push([s,u])}else{var c=e[0]-Math.random()*i,d=e[1]-Math.random()*i;t.push([c,d])}else{var f=e[0]-Math.random()*i,y=e[1]+Math.random()*i;t.push([f,y])}return t}(e.position,e.num,e.density));try{for(a.s();!(o=a.n()).done;){var n=o.value,l=n[0],s=n[1],u=new Cesium.Cartesian3.fromDegrees(l,s,0),c=Math.round(Math.random()*e.height),d=new Cesium.Cartesian3.fromDegrees(l,s,c),f=[];f.push(u),f.push(d);var y=S("vfw_");this.viewer.entities.add({id:y,polyline:{positions:f,width:1.5,material:new ANOVGIS.PolylineVFlywireMaterialPoperty({color:Cesium.Color.fromCssColorString(e.color),speed:Math.round(Math.random()*e.speed),percent:.1,gradient:.01})}}),this.vfwIdList.push(y)}}catch(e){a.e(e)}finally{a.f()}}},{key:"deleteVerFlywire",value:function(){if(this.vfwIdList&&this.vfwIdList.length>0){var e,r=w(this.vfwIdList);try{for(r.s();!(e=r.n()).done;){var i=e.value;this.deleteEffect(i)}}catch(e){r.e(e)}finally{r.f()}this.vfwIdList=[]}}},{key:"showVerFlywire",value:function(e){if(this.vfwIdList&&this.vfwIdList.length>0){var r,i=w(this.vfwIdList);try{for(i.s();!(r=i.n()).done;){var t=r.value;this.showEffect(t,e)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"addFlowLightLine",value:function(e){var r=this,i=S("dsfll_");return Cesium.GeoJsonDataSource.load(e.geojson).then((function(t){t.name=i,r.viewer.dataSources.add(t);var o,a=w(t.entities.values);try{for(a.s();!(o=a.n()).done;){var n=o.value;n.polyline.width=e.width,n.polyline.material=new ANOVGIS.PolylineLightingTrailMaterialProperty({color:Cesium.Color.fromCssColorString(e.color),speed:e.speed})}}catch(e){a.e(e)}finally{a.f()}return i}))}},{key:"deleteFlowLightLine",value:function(e){var r=this.viewer.dataSources.getByName(e);r&&this.viewer.dataSources.remove(r)}},{key:"createParabola",value:function(e){var r,i=new ANOVGIS.PrimitiveLayer({id:e.id}).addTo(this.viewer),t=w(e.parabolas);try{for(t.s();!(r=t.n()).done;){var o=r.value,a=o.lineWidth?o.lineWidth:2,n=o.lineHeight?o.lineHeight:1e3,l=o.speed?o.speed:7*Math.random(),s=o.color?o.color:"rgba(237,175,67,0.9)",u=o.lineOpacity?o.lineOpacity:.2,c=o.lineLightLength?o.lineLightLength:.1,d=ANOVGIS.Position.fromObject({lng:o.center[0],lat:o.center[1]}),f=new ANOVGIS.FlowLinePrimitive(ANOVGIS.parabola(d,{lng:o.target[0],lat:o.target[1]},n),a);f.setOptions({speed:l,color:Cesium.Color.fromCssColorString(s),gradient:u,percent:c}),i.addGraphic(f)}}catch(e){t.e(e)}finally{t.f()}return i}},{key:"deleteParabola",value:function(e){this.viewer.removeLayer(e)}},{key:"createWallArea",value:function(e){var r=JSON.parse(JSON.stringify(e.pointList));r.push(e.pointList[0]);var i=c(r),t=e.height?e.height:200,o=e.color?e.color:"rgba(221,157,8,1)",a=o;switch(e.materialType?e.materialType:0){case 0:default:a=Cesium.Color.fromCssColorString(o);break;case 1:a=new ANOVGIS.WallGradientMaterialProperty({color:Cesium.Color.fromCssColorString(o),duration:1e3,direction:1});break;case 2:a=new ANOVGIS.WallFlowMaterialProperty({color:Cesium.Color.fromCssColorString(o),duration:2600,speed:1,rep:1})}var n={id:S("wallarea_"),wall:{positions:Cesium.Cartesian3.fromDegreesArray(i),maximumHeights:new Array(i.length/2).fill(t),minimumHeights:new Array(i.length/2).fill(0),material:a,outline:!1,outlineColor:Cesium.Color.fromCssColorString("rgba(221,157,8,1)")}};return this.viewer.entities.add(n),n.id}},{key:"createRoadLight",value:function(e){var r=c(e.pointList),i={positions:Cesium.Cartesian3.fromDegreesArray(r),width:e.width,clampToGround:!0,material:new ANOVGIS.PolylineLightingTrailMaterialProperty({color:Cesium.Color.fromCssColorString(e.color),speed:e.speed})};return viewer.entities.add({id:S("rfl_"),polyline:i}).id}}]),e}(),k=function(){function e(r,i){t(this,e),this.viewer=i,this.layerName=r,this.htmlLayer=null,this.option={position:[],height:100,horizontalOrigin:"RIGHT",verticalOrigin:"TOP",offsetX:0,offsetY:0,near:0,nearValue:1,far:1e4,farValue:0,html:"",pointerEvents:!1,extraData:null,winClickHandle:null},this.htmlLayer=function(e,r){var i=new ANOVGIS.HtmlLayer(e);return r.addLayer(i),i}(r,i)}return l(e,[{key:"createInfoWin",value:function(e){var r=new ANOVGIS.DivIcon(new ANOVGIS.Position(e.position[0],e.position[1],e.height),e.html),i={horizontalOrigin:e.horizontalOrigin,verticalOrigin:e.verticalOrigin,offsetX:e.offsetX,offsetY:e.offsetY,pointerEvents:e.pointerEvents,scaleByDistance:{near:e.near,nearValue:e.nearValue,far:e.far,farValue:e.farValue}};r.setOptions(i);var t=e.extraData;return e.pointerEvents&&"function"==typeof e.winClickHandle&&r.addEventListener(ANOVGIS.MouseEventType.CLICK,(function(){e.winClickHandle(t)})),this.htmlLayer.addGraphic(r),r}},{key:"removeLayer",value:function(e){this.htmlLayer&&this.htmlLayer.removeLayer(e)}}]),e}(),O=function(){function e(r){t(this,e),this.viewer=r,this.modelOption={modelId:"plane1",modelPath:"./geojson/Cesium_Air.glb",duration:420,minimumPixelSize:190,maximumScale:2e4,infoBoard:{icon:{isShow:!0,width:35,height:20,pixelOffset:[85,0]},label:{isShow:!0,text:"FB9527",font:"SourceHanSansCN",fontSize:14,color:"red",pixelOffset:[138,0],backgroundColor:"rgba(0, 0, 0, 0.2)",backgroundPadding:[8,6]}},movePath:[{lng:116.44696921,lat:40.05137125,height:50,time:0},{lng:116.44805847,lat:40.03746884,height:50,time:30},{lng:116.44707324,lat:40.02218908,height:800,time:60},{lng:116.43610979,lat:40.00457578,height:1e3,time:120},{lng:116.42906028,lat:39.98889132,height:1e3,time:170},{lng:116.41874731,lat:39.96920989,height:1e3,time:210},{lng:116.41858125,lat:39.94599396,height:1e3,time:260},{lng:116.43184057,lat:39.91934517,height:700,time:300},{lng:116.45221571,lat:39.89278395,height:400,time:340},{lng:116.49054061,lat:39.88948071,height:50,time:380},{lng:116.49654061,lat:39.88948071,height:50,time:420}],selectInfo:{isSelect:!1,boderSize:2,color:"rgba(73,137,255,0.8)",clickHandler:null}}}return l(e,[{key:"loadModel",value:function(e){var r=new Date,i=Cesium.JulianDate.fromDate(r),t=Cesium.JulianDate.addSeconds(i,e.duration,new Cesium.JulianDate);viewer.clock.startTime=i.clone(),viewer.clock.currentTime=i.clone(),viewer.clock.stopTime=t.clone(),viewer.clock.multiplier=8,viewer.clock.clockRange=Cesium.ClockRange.LOOP_STOP;var o=function(e,r){for(var i=new Cesium.SampledPositionProperty,t=0;t<e.length;t++){var o=Cesium.JulianDate.addSeconds(r,e[t].time,new Cesium.JulianDate),a=Cesium.Cartesian3.fromDegrees(e[t].lng,e[t].lat,e[t].height);i.addSample(o,a)}return i}(e.movePath,i),a=function(e){var r={billboard:{},label:{}},i=d(e.infoBoard.icon.pixelOffset,2);if(e.infoBoard.icon.isShow){var t={show:!0,image:e.infoBoard.icon.image?e.infoBoard.icon.image:Cesium.buildModuleUrl("static/images/modelicon.png"),width:e.infoBoard.icon.width?e.infoBoard.icon.width:35,height:e.infoBoard.icon.height?e.infoBoard.icon.height:20,pixelOffset:i?new Cesium.Cartesian2(e.infoBoard.icon.pixelOffset[0],e.infoBoard.icon.pixelOffset[1]):new Cesium.Cartesian2(85,0)};r.billboard=t}if(i=d(e.infoBoard.label.pixelOffset,2),e.infoBoard.label.isShow){var o=e.infoBoard.label.fontSize?e.infoBoard.label.fontSize:14,a=e.infoBoard.label.font?e.infoBoard.label.font:"",n={show:!0,text:e.infoBoard.label.text?e.infoBoard.label.text:"m_"+e.modelId,font:o+"px "+a,pixelOffset:i?new Cesium.Cartesian2(e.infoBoard.label.pixelOffset[0],e.infoBoard.label.pixelOffset[1]):new Cesium.Cartesian2(138,0),showBackground:!e.infoBoard.label.showBackground||e.infoBoard.label.showBackground};if(n.showBackground){n.backgroundColor=e.infoBoard.label.backgroundColor?Cesium.Color.fromCssColorString(e.infoBoard.label.backgroundColor):Cesium.Color.fromCssColorString("rgba(0, 0, 0, 0.2)"),n.fillColor=e.infoBoard.label.color?Cesium.Color.fromCssColorString(e.infoBoard.label.color):Cesium.Color.WHITE;var l=d(e.infoBoard.label.backgroundPadding,2);n.backgroundPadding=l?new Cesium.Cartesian2(e.infoBoard.label.backgroundPadding[0],e.infoBoard.label.backgroundPadding[1]):new Cesium.Cartesian2(8,6)}r.label=n}return r}(e),n=viewer.entities.add({id:e.modelId,billboard:a.billboard,label:a.label,availability:new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({start:i,stop:t})]),position:o,orientation:new Cesium.VelocityOrientationProperty(o),model:{uri:e.modelPath,minimumPixelSize:e.minimumPixelSize,maximumScale:e.maximumScale}});return function(e,r){new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas).setInputAction((function(i){var t=viewer.scene.pick(i.position);if(t&&t.id&&t.id.id==r.id){var o=viewer.scene.globe.pick(viewer.camera.getPickRay(i.position),viewer.scene),a=viewer.scene.globe.ellipsoid.cartesianToCartographic(o),n=Cesium.Math.toDegrees(a.longitude),l=Cesium.Math.toDegrees(a.latitude);if(e.selectInfo.isSelect){var s=e.selectInfo.boderSize?e.selectInfo.boderSize:2,u=e.selectInfo.color?Cesium.Color.fromCssColorString(e.selectInfo.color):Cesium.Color.fromCssColorString("rgba(73,137,255,0.8)");r.model.silhouetteSize=s,r.model.silhouetteColor=u,"function"==typeof e.selectInfo.clickHandler&&e.selectInfo.clickHandler([n,l])}else r.model.silhouetteSize=0}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)}(e,n),n}},{key:"selectModel",value:function(e,r){r.isSelect||(e.model.silhouetteSize=0,e.model.silhouetteColor=Cesium.Color.fromCssColorString("rgba(0,0,0,0)"))}},{key:"modelFollow",value:function(e,r,i){i.nativeObjCesium.trackedEntity=r?e:null}}]),e}();function A(e,r,i){var t=e.options;setTimeout((function(){var o=t[r];console.log("index==>",r),console.log("option==>",o),"function"==typeof o.callBack&&o.callBack(o);var a=r+1;console.log("tempIndex==>",a),a==t.length&&(a=0);var n={position:o.position,height:o.height,duration:o.duration,direction:o.direction,angle:o.angle,callBack:A(e,a,i)};e.isCircle&&i.flyToPosition(n)}),e.interval)}function _(e){var r=d(e.position,2)?e.position:[116.397428,39.97823],i=e.direction?e.direction:0,t=e.angle?e.angle:-40;return{position:r,height:e.height?e.height:4e3,duration:e.duration?e.duration:3,direction:i,angle:t,callBack:e.callBack}}const P=function(){function e(r){t(this,e),this.viewer=r,this.flyOption={position:[116.397428,39.97823],height:5e3,duration:3,direction:0,angle:-40,callBack:null},this.roamOption={isCircle:!0,interval:5e3,options:[{position:[116.397428,39.97823],height:5e3,duration:3,direction:0,angle:-40,callBack:null}]}}return l(e,[{key:"flyToPosition",value:function(e){var r=_(e);ANOVGIS.LocateUtil.flyToPosition(this.viewer,r.position,r.direction,r.angle,r.height,r.duration,r.callBack)}},{key:"cameraRoam",value:function(e){var r=d(e.options,1);if(r)this.flyToPosition(e.options[0]);else if(r=function(e,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!Array.isArray(e))return!1;if(i){if(e.length>=r)return!0}else if(e.length<=r)return!0;return!1}(e.options,2),r){var i=_(e.options[0]);ANOVGIS.LocateUtil.flyToPosition(this.viewer,i.position,i.direction,i.angle,i.height,i.duration,A(e,1,this))}}}]),e}();var M,T,B=function(){function e(){t(this,e)}return l(e,null,[{key:"addWorldLayer",value:function(e){s.addWorldLayer(e)}},{key:"setWorldLayer",value:function(e,r){s.addWorldLayer(e,r)}},{key:"addGeojsonBuild",value:function(e,r,i){new C(i).addGeojsonBuild(e,r)}},{key:"createMapEffect",value:function(e){return new I(e)}},{key:"createHtmlLayer",value:function(e,r){return new k(e,r)}},{key:"createSimpleModel",value:function(e){return new O(e)}},{key:"createRoam",value:function(e){return new P(e)}}]),e}();M=B,(T=a(T="effectObj"))in M?Object.defineProperty(M,T,{value:null,enumerable:!0,configurable:!0,writable:!0}):M[T]=null;const G={ApplyApi:B}}},r={};function i(t){var o=r[t];if(void 0!==o)return o.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,i),a.exports}i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};return(()=>{i.r(t),i.d(t,{default:()=>r});var e=function(e){if(!e)throw new Error("Missing ANOVGIS Package");e.Initialized_applyfn||(e.initEnvironment(),e.Initialized&&e.mixin(i(274).Z),e.Initialized_applyfn=!0)};"undefined"!=typeof window&&window.ANOVGIS&&e(window.ANOVGIS);const r={version:"1.0.1",author:"huj75@chinaunicom.cn",install:e}})(),t})()));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|