| | |
| | | this.leftClick.setInputAction(function (event) { |
| | | let nPickFeature = Viewer.scene.pick(event.position); |
| | | let cartesian = window.Viewer.camera.pickEllipsoid(event.position); |
| | | |
| | | |
| | | let cartographic = Cesium.Cartographic.fromCartesian(cartesian); |
| | | let lng = Cesium.Math.toDegrees(cartographic.longitude); // 经度 |
| | | let lat = Cesium.Math.toDegrees(cartographic.latitude); // 纬度 |
| | | let alt = cartographic.height; // 高度,椭球面height永远等于 |
| | | let coordinate = { |
| | | longitude: Number(lng.toFixed(6)), |
| | | latitude: Number(lat.toFixed(6)), |
| | | longitude: Number(lng), |
| | | latitude: Number(lat), |
| | | altitude: Number(alt.toFixed(2)), |
| | | heading: 0, |
| | | pitch: 0, |
| | | roll: 0, |
| | | scale: 1, |
| | | }; |
| | | |
| | | store.state.coordinate = coordinate; |
| | | if (store.state.addModelFlag) { |
| | | model.setModelCoord(coordinate); |
| | | if(store.state.isBatchGridArr){ |
| | | |
| | | } |
| | | if(store.state.isMeasureFlag){ |
| | | }else if (store.state.addModelFlag) { |
| | | model.setModelCoord(coordinate); |
| | | |
| | | }else if (store.state.isMeasureFlag) { |
| | | store.state.measureCoordObj = coordinate; |
| | | store.state.isShowMeasureCoord= true; |
| | | } |
| | | if (Cesium.defined(nPickFeature)) { |
| | | |
| | | if(nPickFeature.id && nPickFeature.id.properties){ |
| | | console.log(nPickFeature) |
| | | store.state.isShowMeasureCoord = true; |
| | | |
| | | }else if (store.state.isQueryFalag) { |
| | | |
| | | store.state.isQyeryCoord = coordinate; |
| | | |
| | | }else if (Cesium.defined(nPickFeature)) { |
| | | mapInfo.setRestLayer(); |
| | | if (nPickFeature.id && nPickFeature.id.id == 'Rectangle') |
| | | return |
| | | |
| | | if (nPickFeature.id && nPickFeature.id.properties) { |
| | | mapInfo.setGeoJsonInfo(nPickFeature.id.properties) |
| | | }else if(nPickFeature && nPickFeature.getProperty("name") == "DLJQT0007"){ |
| | | store.state.isShowVideo= true; |
| | | |
| | | } else if (nPickFeature && nPickFeature.getProperty("name")) { |
| | | var name = nPickFeature.getProperty("name"); |
| | | if (name == "DLJQT0007") { |
| | | store.state.isShowVideo = true; |
| | | } else if (name == "sensor001") { |
| | | |
| | | } else if (name == "DLLMJ0001") { |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3493&type=8"; |
| | | store.state.isShowMenuCount = true; |
| | | } else if (name == "DLBZP0023") { |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3494&type=5"; |
| | | store.state.isShowMenuCount = true; |
| | | } else if (name == "DLBZP0024") { |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3491&type=8"; |
| | | store.state.isShowMenuCount = true; |
| | | }else if(name === "DLBZP0026"){ |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3505&type=8"; |
| | | store.state.isShowMenuCount = true; |
| | | }else if(name === "DLBZP0029"){ |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3646&type=5"; |
| | | store.state.isShowMenuCount = true; |
| | | }else if(name === "DLBZP0027"){ |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3685&type=99"; |
| | | store.state.isShowMenuCount = true; |
| | | } else if(name === "DLBZP0027"){ |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3685&type=99"; |
| | | store.state.isShowMenuCount = true; |
| | | }else if(name === "DLBZP0072"){ |
| | | store.state.isireamUrl = "/Data/html/hd3dmap.html?id=3719&type=5"; |
| | | store.state.isShowMenuCount = true; |
| | | }else{ |
| | | mapInfo.setTileSetInfo(nPickFeature) |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | |
| | | } |
| | | } |
| | | if(store.state.isQueryFalag){ |
| | | |
| | | store.state.isQyeryCoord = coordinate; |
| | | } |
| | | |
| | | |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | }, |
| | | addRightClick() { |