Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
9 files modified
1 files added
1 files deleted
| New file |
| | |
| | | .vscode/settings.json |
| | |
| | | var geodesic = new Cesium.EllipsoidGeodesic(); |
| | | geodesic.setEndPoints(point1cartographic, point2cartographic); |
| | | var s = geodesic.surfaceDistance; |
| | | //console.log(Math.sqrt(Math.pow(distance, 2) + Math.pow(endheight, 2))); |
| | | //返回两点之间的距离 |
| | | s = Math.sqrt(Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2)); |
| | | distance = distance + s; |
| | |
| | | |
| | | } |
| | | |
| | | #passPoint, |
| | | #passPoint li { |
| | | .jimu-widget-FlyRoute #passPoint, |
| | | .jimu-widget-FlyRoute #passPoint li { |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | |
| | | #passPoint { |
| | | .jimu-widget-FlyRoute #passPoint { |
| | | height: 100%; |
| | | list-style: none; |
| | | overflow: auto; |
| | | } |
| | | |
| | | #passPoint li { |
| | | .jimu-widget-FlyRoute #passPoint li { |
| | | margin: 10px 40px; |
| | | } |
| | | |
| | | .item { |
| | | .jimu-widget-FlyRoute .item { |
| | | background: #3E9FFC; |
| | | border-radius: 5px; |
| | | height: 20px; |
| | |
| | | font-family: "微软雅黑"; |
| | | text-align: center; |
| | | margin-bottom: 5px; |
| | | cursor: pointer; |
| | | } |
| | | .item:nth-child(1){ |
| | | |
| | | .jimu-widget-FlyRoute .item:nth-child(1) { |
| | | margin-top: 20px !important; |
| | | } |
| | | |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | img_path |
| | | }; |
| | | this.RouteCollection = { |
| | | //线颜色 |
| | |
| | | }; |
| | | |
| | | this.flyManager = { |
| | | img_path: "widgets/FlyRoute/images/location4.png", |
| | | //用于储存暂停时的位置 |
| | | Site_pause: {}, |
| | | play: function () { |
| | | |
| | | for (var i = 0; i < that.allSites.length; i++) { |
| | | that.entities.removeById(that.allSites[i].ids); |
| | | } |
| | | |
| | | //如果之前点的时停止重新开始飞行 |
| | | if (that.allSites.length > 1) { |
| | | that.scene.screenSpaceCameraController.enableRotate = false; |
| | |
| | | |
| | | }, |
| | | stop: function () { |
| | | //添加显示的站点 |
| | | var length = that.allSites.length; |
| | | for (var j = 0; j < length; j++) { |
| | | var flag = false; |
| | | for (var i = 0; i < that.entities.values.length; i++) { |
| | | if (that.allSites[j].ids == that.entities.values[i].id) { |
| | | flag = true |
| | | } |
| | | } |
| | | if (flag == false) { |
| | | that.entities.add({ |
| | | position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z), |
| | | billboard: { |
| | | image: this.img_path, |
| | | width: 30, |
| | | height: 40, |
| | | }, |
| | | //name : 10000+j, |
| | | id: that.allSites[j].ids |
| | | }); |
| | | } |
| | | } |
| | | if (that.setInterval_fly != null) { |
| | | clearInterval(that.setInterval_fly); |
| | | that.setInterval_fly = null; |
| | |
| | | that.scene.screenSpaceCameraController.enableLook = true; |
| | | }, |
| | | pause: function () { |
| | | |
| | | //添加显示的站点 |
| | | var length = that.allSites.length; |
| | | for (var j = 0; j < length; j++) { |
| | | var flag = false; |
| | | for (var i = 0; i < that.entities.values.length; i++) { |
| | | if (that.allSites[j].ids == that.entities.values[i].id) { |
| | | flag = true |
| | | } |
| | | } |
| | | if (flag == false) { |
| | | that.entities.add({ |
| | | position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z), |
| | | billboard: { |
| | | image: this.img_path, |
| | | width: 30, |
| | | height: 40, |
| | | }, |
| | | //name : 10000+j, |
| | | id: that.allSites[j].ids |
| | | }); |
| | | } |
| | | } |
| | | if (that.setInterval_fly != null) { |
| | | clearInterval(that.setInterval_fly); |
| | | that.setInterval_fly = null; |
| | |
| | | [ |
| | | { |
| | | "name": "鄱阳湖区域漫游", |
| | | "sites": [{ |
| | | "id": 0, |
| | | "lgtd": 116.07058093094358, |
| | | "lttd": 27.184663292017, |
| | | "height": 532631.4094937699, |
| | | "heading": 359.6129683240469, |
| | | "pitch": -70.00710878828988, |
| | | "roll": 360, |
| | | "time": 6.850034082471008 |
| | | }, { |
| | | "id": 1, |
| | | "lgtd": 116.25512974333309, |
| | | "lttd": 27.853702327099285, |
| | | "height": 305470.9898066192, |
| | | "heading": 359.70207852770284, |
| | | "pitch": -69.33940061867362, |
| | | "roll": 360, |
| | | "time": 6.09188099321279 |
| | | }, { |
| | | "id": 2, |
| | | "lgtd": 116.87438690284296, |
| | | "lttd": 28.07209675928174, |
| | | "height": 195618.08555063797, |
| | | "heading": 335.78104347667, |
| | | "pitch": -60.15289761069373, |
| | | "roll": 359.9999999999998, |
| | | "time": 3.83931030989409 |
| | | }, { |
| | | "id": 3, |
| | | "lgtd": 117.3848954360908, |
| | | "lttd": 28.418880183254686, |
| | | "height": 145578.46205320535, |
| | | "heading": 303.4664334773321, |
| | | "pitch": -51.067133324175536, |
| | | "roll": 0.21269261644604548, |
| | | "time": 3.5540119827310 |
| | | }, { |
| | | "id": 4, |
| | | "lgtd": 117.48504208464011, |
| | | "lttd": 29.045157089042483, |
| | | "height": 120793.91646938979, |
| | | "heading": 268.29402900759607, |
| | | "pitch": -50.89234760168597, |
| | | "roll": 0.3245162423802251, |
| | | "time": 4.41772559488863 |
| | | }, { |
| | | "id": 5, |
| | | "lgtd": 116.94437687681176, |
| | | "lttd": 29.70740749923287, |
| | | "height": 100271.73076036082, |
| | | "heading": 221.68475847472152, |
| | | "pitch": -50.73760876731254, |
| | | "roll": 0.5294196415387289, |
| | | "time": 3.3793924185111 |
| | | }, { |
| | | "id": 6, |
| | | "lgtd": 116.30105729691545, |
| | | "lttd": 29.833951091691258, |
| | | "height": 69066.51546120155, |
| | | "heading": 181.27648139038828, |
| | | "pitch": -50.500089269987804, |
| | | "roll": 0.3071825073204896, |
| | | "time": 2.754614312861 |
| | | }, { |
| | | "id": 7, |
| | | "lgtd": 115.77814656571745, |
| | | "lttd": 29.58145675881515, |
| | | "height": 69066.5154612108, |
| | | "heading": 132.4678318250673, |
| | | "pitch": -50.50008926998791, |
| | | "roll": 0.38509722638949384, |
| | | "time": 3.75766326951769 |
| | | }, { |
| | | "id": 8, |
| | | "lgtd": 115.46108315235654, |
| | | "lttd": 28.92891807580572, |
| | | "height": 70518.18734055498, |
| | | "heading": 73.48401755402136, |
| | | "pitch": -44.60008123257843, |
| | | "roll": 0.25983005636820594, |
| | | "time": 2.76440055039805 |
| | | }, { |
| | | "id": 9, |
| | | "lgtd": 115.81260512558674, |
| | | "lttd": 28.508300457565948, |
| | | "height": 70518.18734055119, |
| | | "heading": 34.14274724799936, |
| | | "pitch": -44.60008123257815, |
| | | "roll": 0.145054389072955, |
| | | "time": 2.20971041939766 |
| | | }, { |
| | | "id": 10, |
| | | "lgtd": 116.22128285432908, |
| | | "lttd": 28.29725791623307, |
| | | "height": 70518.18734055535, |
| | | "heading": 7.109417805111491, |
| | | "pitch": -44.60008123257818, |
| | | "roll": 0.19844760769502565, |
| | | "time": 2.49504989630838 |
| | | }, { |
| | | "id": 11, |
| | | "lgtd": 116.74255382809167, |
| | | "lttd": 28.402559624562997, |
| | | "height": 70518.1873405681, |
| | | "heading": -23.70028981224687, |
| | | "pitch": -44.60008123257818, |
| | | "roll": 0.21392949135740552, |
| | | "time": 4.63507650428665 |
| | | }, { |
| | | "id": 12, |
| | | "lgtd": 117.54126872910363, |
| | | "lttd": 28.521693627213544, |
| | | "height": 126986.38248378983, |
| | | "heading": -63.3672603044896, |
| | | "pitch": -47.43087935636498, |
| | | "roll": 0.3136332255315753, |
| | | "time": 6.916175825561835 |
| | | }] |
| | | }, |
| | | { |
| | | "name": "鄱阳湖区域浏览2", |
| | | "sites": [{ |
| | | "id": 0, |
| | | "lgtd": 116.36485651934478, |
| | | "lttd": 28.61499997888566, |
| | | "height": 21615.65670519218, |
| | | "heading": 357.5324369211186, |
| | | "pitch": -33.949736768804875, |
| | | "roll": 0.07493032373110281, |
| | | "time": 3 |
| | | }, { |
| | | "id": 1, |
| | | "lgtd": 116.61798359831062, |
| | | "lttd": 28.678026785994387, |
| | | "height": 21615.65670518082, |
| | | "heading": 328.4540952954534, |
| | | "pitch": -33.9497367688052, |
| | | "roll": 0.1007963589203403, |
| | | "time": 3 |
| | | }, { |
| | | "id": 2, |
| | | "lgtd": 116.87603493936163, |
| | | "lttd": 28.921761691820024, |
| | | "height": 21615.6567051778, |
| | | "heading": 287.79156780309444, |
| | | "pitch": -33.94973676880269, |
| | | "roll": 0.12547175713320183, |
| | | "time": 3 |
| | | }, { |
| | | "id": 3, |
| | | "lgtd": 116.909026583975, |
| | | "lttd": 29.210477509533032, |
| | | "height": 21615.656705175323, |
| | | "heading": 250.72860434190048, |
| | | "pitch": -33.94973676880164, |
| | | "roll": 0.1182078443376804, |
| | | "time": 3 |
| | | }, { |
| | | "id": 4, |
| | | "lgtd": 116.83971215830472, |
| | | "lttd": 29.411874687056383, |
| | | "height": 21615.656705178324, |
| | | "heading": 220.5678813179093, |
| | | "pitch": -33.949736768801614, |
| | | "roll": 0.14418892227725896, |
| | | "time": 3 |
| | | }, { |
| | | "id": 5, |
| | | "lgtd": 116.63736760852666, |
| | | "lttd": 29.559276610554274, |
| | | "height": 21615.65670518267, |
| | | "heading": 192.7750271204978, |
| | | "pitch": -33.94973676880136, |
| | | "roll": 0.11990434840510432, |
| | | "time": 3 |
| | | }, { |
| | | "id": 6, |
| | | "lgtd": 116.35268250530002, |
| | | "lttd": 29.569093455601525, |
| | | "height": 21615.656705182217, |
| | | "heading": 159.031653642729, |
| | | "pitch": -33.949736768801486, |
| | | "roll": 0.12226477526126023, |
| | | "time": 3 |
| | | }, { |
| | | "id": 7, |
| | | "lgtd": 116.03398252452703, |
| | | "lttd": 29.43313255053548, |
| | | "height": 21615.656705183854, |
| | | "heading": 129.44379294438437, |
| | | "pitch": -33.949736768801486, |
| | | "roll": 0.1399973458170845, |
| | | "time": 3 |
| | | }, { |
| | | "id": 8, |
| | | "lgtd": 115.56656976497351, |
| | | "lttd": 29.31417361097843, |
| | | "height": 36832.409250694924, |
| | | "heading": 104.1903000851007, |
| | | "pitch": -36.64434419262527, |
| | | "roll": 359.9999999990976, |
| | | "time": 3 |
| | | }, { |
| | | "id": 9, |
| | | "lgtd": 115.740825901675, |
| | | "lttd": 28.69543529618644, |
| | | "height": 29061.533148178412, |
| | | "heading": 48.8874638325123, |
| | | "pitch": -37.012291045271574, |
| | | "roll": 0.13594606119813848, |
| | | "time": 3 |
| | | }, { |
| | | "id": 10, |
| | | "lgtd": 116.04912917565872, |
| | | "lttd": 28.499254393238655, |
| | | "height": 24977.858469140665, |
| | | "heading": 23.312402615521254, |
| | | "pitch": -36.97115669047082, |
| | | "roll": 0.1669937889431866, |
| | | "time": 3 |
| | | }, { |
| | | "id": 11, |
| | | "lgtd": 116.0488849187321, |
| | | "lttd": 27.591614215992426, |
| | | "height": 100049.13699253049, |
| | | "heading": 10.451947125671502, |
| | | "pitch": -37.89649963820525, |
| | | "roll": 0.15288734882291413, |
| | | "time": 3 |
| | | }] |
| | | }, |
| | | { |
| | | "name": "鄱阳湖国家级保护区倾斜飞行路线1", |
| | | "sites": [{ |
| | | "id": 0, |
| | |
| | | id: d[k].id, |
| | | serviceName: d[k].serviceName, |
| | | alpha: 1, |
| | | checked: d[k].menuStatus |
| | | checked: d[k].menuStatus, |
| | | attList: d[k].attList |
| | | } |
| | | |
| | | if (that[d[k].id]) { |
| | |
| | | } |
| | | |
| | | if (d[k].serviceUrl && d[k].serviceUrl.length > 0 && d[k].serviceUrl.indexOf('.openrealspace') != -1) { |
| | | a.model = true |
| | | a.model = true; |
| | | a.lat = d[k].lat; |
| | | a.lon = d[k].lon; |
| | | a.height = d[k].height; |
| | | a.yawAngle = d[k].yawAngle; |
| | | a.pitchAngle = d[k].pitchAngle; |
| | | a.rollAngle = d[k].rollAngle; |
| | | } |
| | | |
| | | if (d[k].name == '三维倾斜数据') { |
| | | a.model = true |
| | | } |
| | | |
| | | if (a.model) { |
| | | |
| | | if (that[a.id]) { |
| | | Cesium.when(that[a.id], function (layer) { |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | b.push(a); |
| | | i++; |
| | |
| | | function deWeight() { |
| | | for (var j = 0; j < data[i].children.length; j++) { |
| | | |
| | | if (data[i].children[j].checked == true) { |
| | | var small = data[i].children[j]; |
| | | if (small.model) { |
| | | that.map.scene.globe.depthTestAgainstTerrain = false; |
| | | var host = that.returnStr(small.src).host; |
| | | var scene = that.map.scene; |
| | | var partOfUrl = that.returnStr(small.src).partOfUrl; |
| | | //添加S3M图层服务 |
| | | that[small.id] = scene.open(host + partOfUrl); |
| | | } |
| | | } |
| | | |
| | | if (data[i].children[j].title && data[i].children[j].title.indexOf(type) == -1) { |
| | | data[i].children.splice(j, 1); |
| | | deWeight(); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | deParentWeight() |
| | |
| | | data[i].checked = true |
| | | } |
| | | |
| | | if (data[i].children && data[i].children.length > 0) { |
| | | |
| | | for (var j = 0; j < data[i].children.length; j++) { |
| | | |
| | | if (data[i].children[j].id == keyId) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | showLine: false, //是否开启连接线 |
| | | oncheck: function (obj) { |
| | | |
| | | var keyId = that.getUrlKeyId("serviceId"); |
| | | |
| | | if (obj.data.children && obj.data.children.length > 0) { |
| | | |
| | | // 点击的父 |
| | | |
| | | |
| | | |
| | | |
| | | if (obj.checked == true) { |
| | | |
| | | if (obj.data.model) { |
| | | that.map.scene.globe.depthTestAgainstTerrain = false; |
| | | obj.data.children.forEach(item => { |
| | | Cesium.when(that[item.id], function (layer) { |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | var host = that.returnStr(item.src).host; |
| | | var scene = that.map.scene; |
| | | var partOfUrl = that.returnStr(item.src).partOfUrl; |
| | |
| | | that[item.id] = scene.open(host + partOfUrl); |
| | | //定位到场景 |
| | | Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) { |
| | | // var sname = scenes[0].name; |
| | | // Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | | // var cameraPosition = jsonData.camera; |
| | | // var tilt = Cesium.Math.toRadians(cameraPosition.tilt - 90); |
| | | // Cesium.when(promise, function (layer) { |
| | | // //设置相机位置、视角,便于观察场景 |
| | | // scene.camera.setView({ |
| | | // destination: new Cesium.Cartesian3.fromDegrees(cameraPosition.longitude, cameraPosition.latitude, cameraPosition.altitude), |
| | | // orientation: { |
| | | // heading: cameraPosition.heading, |
| | | // pitch: tilt, |
| | | // roll: 0 |
| | | // } |
| | | // }); |
| | | // if (!scene.pickPositionSupported) { |
| | | // alert('不支持深度纹理,无法拾取位置!'); |
| | | // } |
| | | // }, function (e) { |
| | | // if (widget._showRenderLoopErrors) { |
| | | // var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | // widget.showErrorPanel(title, undefined, e); |
| | | // } |
| | | // }); |
| | | // }); |
| | | var sname = scenes[0].name; |
| | | Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | | Cesium.when(that[item.id], function (layer) { |
| | | //设置相机位置、视角,便于观察场景 |
| | | scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3.fromDegrees(Number(item.lon), Number(item.lat), Number(item.height)), |
| | | orientation: { |
| | | heading: Cesium.Math.toRadians(Number(item.yawAngle)), |
| | | pitch: Cesium.Math.toRadians(Number(item.pitchAngle)), |
| | | roll: Cesium.Math.toRadians(Number(item.rollAngle)) |
| | | } |
| | | }); |
| | | if (!scene.pickPositionSupported) { |
| | | alert('不支持深度纹理,无法拾取位置!'); |
| | | } |
| | | }, function (e) { |
| | | if (widget._showRenderLoopErrors) { |
| | | var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | widget.showErrorPanel(title, undefined, e); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | }); |
| | | } else { |
| | |
| | | |
| | | if (that[item.id]) { |
| | | that[item.id].show = true |
| | | that[item.id].getViewableRectangle().then(function (rectangle) { |
| | | return that.map.camera.flyTo({ |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | topic.publish('appendItem', 'Layermanagement', item, that[item.id]); |
| | | topic.publish('addLayersLegends', 'legends', item); |
| | | } else { |
| | | $.ajax({ |
| | | url: item.src + '/maps.json', |
| | |
| | | url: res[0].path, |
| | | })); |
| | | topic.publish('appendItem', 'Layermanagement', item, that[item.id]); |
| | | that[item.id].alpha = item.alpha |
| | | |
| | | if (keyId && keyId != "") { |
| | | topic.publish('addLayersLegends', 'legends', item); |
| | | that[item.id].alpha = item.alpha; |
| | | that[item.id].getViewableRectangle().then(function (rectangle) { |
| | | return that.map.camera.flyTo({ |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | obj.data.children.forEach(item => { |
| | | if (that[item.id]) { |
| | | topic.publish('removeItem', 'Layermanagement', item); |
| | | topic.publish('removeLayersLegends', 'legends', item); |
| | | that[item.id].show = false; |
| | | } |
| | | }); |
| | |
| | | |
| | | } else { |
| | | |
| | | |
| | | // 点击的子 |
| | | |
| | | if (obj.checked == true) { |
| | | |
| | | if (obj.data.model) { |
| | | Cesium.when(that[obj.data.id], function (layer) { |
| | | that.map.scene.layers.remove(layer[0].name) |
| | | }) |
| | | |
| | | that.map.scene.globe.depthTestAgainstTerrain = false; |
| | | var host = that.returnStr(obj.data.src).host; |
| | | var scene = that.map.scene; |
| | | var partOfUrl = that.returnStr(obj.data.src).partOfUrl; |
| | | //添加S3M图层服务 |
| | | |
| | | that[obj.data.id] = scene.open(host + partOfUrl); |
| | | //定位到场景 |
| | | |
| | | Cesium.loadJson(host + partOfUrl + '/scenes.json').then(function (scenes) { |
| | | // var sname = scenes[0].name; |
| | | // Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | | // var cameraPosition = jsonData.camera; |
| | | // var tilt = Cesium.Math.toRadians(cameraPosition.tilt - 90); |
| | | // Cesium.when(promise, function (layer) { |
| | | // //设置相机位置、视角,便于观察场景 |
| | | // scene.camera.setView({ |
| | | // destination: new Cesium.Cartesian3.fromDegrees(cameraPosition.longitude, cameraPosition.latitude, cameraPosition.altitude), |
| | | // orientation: { |
| | | // heading: cameraPosition.heading, |
| | | // pitch: tilt, |
| | | // roll: 0 |
| | | // } |
| | | // }); |
| | | // if (!scene.pickPositionSupported) { |
| | | // alert('不支持深度纹理,无法拾取位置!'); |
| | | // } |
| | | // }, function (e) { |
| | | // if (widget._showRenderLoopErrors) { |
| | | // var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | // widget.showErrorPanel(title, undefined, e); |
| | | // } |
| | | // }); |
| | | // }); |
| | | var sname = scenes[0].name; |
| | | Cesium.loadJson(host + partOfUrl + '/scenes/' + sname + '.json').then(function (jsonData) { |
| | | Cesium.when(that[obj.data.id], function (layer) { |
| | | //设置相机位置、视角,便于观察场景 |
| | | scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3.fromDegrees(Number(obj.data.lon), Number(obj.data.lat), Number(obj.data.height)), |
| | | orientation: { |
| | | heading: Cesium.Math.toRadians(Number(obj.data.yawAngle)), |
| | | pitch: Cesium.Math.toRadians(Number(obj.data.pitchAngle)), |
| | | roll: Cesium.Math.toRadians(Number(obj.data.rollAngle)) |
| | | } |
| | | }); |
| | | if (!scene.pickPositionSupported) { |
| | | alert('不支持深度纹理,无法拾取位置!'); |
| | | } |
| | | }, function (e) { |
| | | if (widget._showRenderLoopErrors) { |
| | | var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | widget.showErrorPanel(title, undefined, e); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | } else { |
| | | |
| | | if (that[obj.data.id]) { |
| | | that[obj.data.id].show = true; |
| | | that[obj.data.id].getViewableRectangle().then(function (rectangle) { |
| | | return that.map.camera.flyTo({ |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]); |
| | | topic.publish('addLayersLegends', 'legends', obj.data); |
| | | } else { |
| | | $.ajax({ |
| | | url: obj.data.src + '/maps.json', |
| | |
| | | })); |
| | | |
| | | topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]); |
| | | topic.publish('addLayersLegends', 'legends', obj.data); |
| | | |
| | | that[obj.data.id].alpha = obj.data.alpha |
| | | |
| | | if (keyId && keyId != "") { |
| | | that[obj.data.id].getViewableRectangle().then(function (rectangle) { |
| | | return that.map.camera.flyTo({ |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | if (that[obj.data.id]) { |
| | | topic.publish('removeItem', 'Layermanagement', obj.data); |
| | | topic.publish('removeLayersLegends', 'legends', obj.data); |
| | | that[obj.data.id].show = false; |
| | | } |
| | | |
| | |
| | | // 关闭标记 |
| | | topic.publish('closeSign', 'Sign'); |
| | | topic.publish('closeFlyRoute', 'FlyRoute'); |
| | | |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-MapPrinting').hide(); |
| | | |
| | |
| | | <div class="m-init"> <i class="m-init-h"><img src="./images/addL/监测.png" /></i> 监测站点 <i>(0个)</i> </div> |
| | | <!-- <div class="m-init m-i-child"> <i></i> 大湖池 <i>(1个)</i> </div> --> |
| | | </div> |
| | | <div class="m-init"> <i class="m-init-h"><img src="./images/addL/forgin.png" /></i> 鄱阳湖面积 <i>(3253.52公顷)</i> </div> |
| | | <ul class="layer-legends"> |
| | | |
| | | </ul> |
| | | <!-- <div class="m-init"> <i class="m-init-h"><img src="./images/addL/forgin.png" /></i> 鄱阳湖面积 <i>(3253.52公顷)</i> </div> |
| | | <div class="m-init"> <i class="m-init-h"><img src="./images/addL/fred.png" /></i> 鄱阳湖范围 <i></i> </div> |
| | | <div class="m-init"> <i class="m-init-h ccsliu"><img src="./images/addL/fblue.png" /></i> 其他 <i></i> </div> |
| | | <div class="m-init"> <i class="m-init-h ccsliu"><img src="./images/addL/fblue.png" /></i> 其他 <i></i> </div> --> |
| | | </div> |
| | | </div> |
| | |
| | | startup: function () { |
| | | // 暴露在外的接口 |
| | | topic.subscribe("getLegendsData", lang.hitch(this, this.onGetLegendsData)); |
| | | topic.subscribe("addLayersLegends", lang.hitch(this, this.addLayersLegends)); |
| | | topic.subscribe("removeLayersLegends", lang.hitch(this, this.removeLayersLegends)); |
| | | |
| | | }, |
| | | onGetLegendsData: function (item) { |
| | | var val = item == ' ' ? '' : item; |
| | | // console.log(val) |
| | | var that = this |
| | | , twoData = [] |
| | | var that = this, |
| | | twoData = [] |
| | | // url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=&start&limit&type=${index}` |
| | | , token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyMjU5OTcsImV4cCI6MTYyNTgxNzk5N30.zWpoKa5AK7xLIPNm-CXoHY9D5kpk9AiUTGkuAQOZi2Rdl2BfroT4IqxjBpyUPZlgwCjG2CoJqy_7rnnodpmqNw' |
| | | , myGet = function (val, i) { |
| | | , |
| | | token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyMjU5OTcsImV4cCI6MTYyNTgxNzk5N30.zWpoKa5AK7xLIPNm-CXoHY9D5kpk9AiUTGkuAQOZi2Rdl2BfroT4IqxjBpyUPZlgwCjG2CoJqy_7rnnodpmqNw', |
| | | myGet = function (val, i) { |
| | | var url = `http://171.34.76.171:8880/pyh-wetResource/monitorRecords/queryMonitorData?name=${val}&start&limit&type=${i}`; |
| | | axios.get(url, { |
| | | headers: { |
| | |
| | | } |
| | | }).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || [] |
| | | , onceData = {}; |
| | | // console.log(data); |
| | | var data = res.data.data.panoramaList || res.data.data.stationList || res.data.data.videoList || [], |
| | | onceData = {}; |
| | | for (var k in data) { |
| | | if (i == 0) { |
| | | onceData[data[k].protectArea] = onceData[data[k].protectArea] == undefined ? 1 : onceData[data[k].protectArea] += 1; |
| | |
| | | console.log('请求访问失败') |
| | | } |
| | | }) |
| | | } |
| | | , ready = function (d, val) { |
| | | // console.log(d); |
| | | }, |
| | | ready = function (d, val) { |
| | | if (val == '') { |
| | | d = {}; |
| | | } |
| | | var init = (data, dom, img) => { |
| | | var q = data |
| | | , num = 0 |
| | | , strq |
| | | , domq = $(dom) |
| | | , h = ''; |
| | | var q = data, |
| | | num = 0, |
| | | strq, domq = $(dom), |
| | | h = ''; |
| | | domq.empty(); |
| | | for (var k in q) { |
| | | num += q[k]; |
| | |
| | | init(d[2], '#legendsInjiankong', '监控'); |
| | | // 监测 |
| | | init(d[1], '#legendsInjiance', '监测'); |
| | | } |
| | | , doit = () => { |
| | | }, |
| | | doit = () => { |
| | | var i = 0; |
| | | myGet(val, i); |
| | | var i = 1; |
| | |
| | | |
| | | doit(); |
| | | }, |
| | | closeToolBox: function (item) { |
| | | addLayersLegends: function (item, obj) { |
| | | |
| | | if (item == this.name) { |
| | | if (obj.attList && obj.attList.length > 0) { |
| | | for (var i = 0; i < obj.attList.length; i++) { |
| | | var list = $("<li class='m-init' itemid='" + obj.id + "'>" + |
| | | "<i class='m-init-h'><img src='" + obj.attList[i].uaOriginPath + "' /></i>" + |
| | | "<span title='" + obj.title + "'>" + |
| | | obj.title + |
| | | "</span>" + |
| | | "</li>") |
| | | |
| | | $(".jimu-widget-legends .layer-legends").append(list); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | removeLayersLegends: function (item, obj) { |
| | | if (item == this.name) { |
| | | var liList = $(".jimu-widget-legends .layer-legends li"); |
| | | for (var i = 0; i < liList.length; i++) { |
| | | if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id) { |
| | | $(liList[i]).remove(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | closeToolBox: function (item) {}, |
| | | |
| | | onOpen: function () { |
| | | //面板打开的时候触发 (when open this panel trigger) |
| | |
| | | resize: function () { |
| | | |
| | | }, |
| | | begin: function () { |
| | | }, |
| | | begin: function () {}, |
| | | |
| | | destroy: function () { |
| | | //销毁的时候触发 |
| | |
| | | background: rgba(0, 0, 0, 0.5); |
| | | color: #fff; |
| | | /* border-right : 1px solid rgba(0, 0, 0, 0.3); */ |
| | | border-radius: 6px 6px 6px 6px; |
| | | border-radius: 8px; |
| | | /* text-align : center; */ |
| | | /* cursor : pointer; */ |
| | | z-index: 15 !important; |
| | | box-sizing: border-box; |
| | | padding: 0 6px 0 6px!important; |
| | | padding: 0 8px 8px 8px!important; |
| | | /* overflow: auto; */ |
| | | transition: all 0.5s; |
| | | } |
| | |
| | | .jimu-widget-legends .main .m-i-child i:nth-child(1) { |
| | | /* margin-right: 30px !important; */ |
| | | } |
| | | |
| | | .jimu-widget-legends .layer-legends li { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | } |
| | | .jimu-widget-legends .layer-legends li .m-init-h { |
| | | width: auto; |
| | | margin-right: 10px !important; |
| | | } |
| | | |
| | | .jimu-widget-legends .layer-legends li .m-init-h img { |
| | | width: auto; |
| | | height: 28px; |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | .jimu-widget-legends .layer-legends li span{ |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |