| | |
| | | if (this.localPoint) { |
| | | this.setLocalPositionClose(); |
| | | } |
| | | var position = { |
| | | X: parseFloat(res.lon), |
| | | Y: parseFloat(res.lat), |
| | | Altitude: parseFloat(res.alt), |
| | | }; |
| | | this.localPoint = window.sgworld.Creator.CreateImageLabel( |
| | | position, |
| | | config.StaticFileBaseUrl + "/Workers/image/mark.png", |
| | | {}, |
| | | 0, |
| | | "标签点" |
| | | ); |
| | | var id = this.localPoint.item.id; |
| | | window.sgworld.Navigate.flyToObj(this.localPoint.item); |
| | | // var position = { |
| | | // X: parseFloat(res.lon), |
| | | // Y: parseFloat(res.lat), |
| | | // Altitude: parseFloat(res.alt), |
| | | // }; |
| | | // this.localPoint = window.sgworld.Creator.CreateImageLabel( |
| | | // position, |
| | | // config.StaticFileBaseUrl + "/Workers/image/mark.png", |
| | | // {}, |
| | | // 0, |
| | | // "标签点" |
| | | // ); |
| | | // var id = this.localPoint.item.id; |
| | | // window.sgworld.Navigate.flyToObj(this.localPoint.item); |
| | | this.localPoint = window.Viewer.entities.add({ |
| | | name: '坐标定位', |
| | | position: Cesium.Cartesian3.fromDegrees(parseFloat(res.lon), parseFloat(res.lat), res.alt == null ? parseFloat(res.alt) : 0), |
| | | billboard: { |
| | | image: config.StaticFileBaseUrl + '/Workers/image/location.png', |
| | | // 设置贴地 |
| | | heightReference: Cesium.Color.CORNFLOWERBLUE.withAlpha(0.4), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | scale: 1.0, |
| | | }, |
| | | }); |
| | | this.setViewerFlyTo(this.localPoint) |
| | | }, |
| | | setLocalPositionClose() { |
| | | this.localPoint.deleteObject(); |
| | | this.localPoint = null; |
| | | if (this.localPoint) { |
| | | // this.localPoint.deleteObject(); |
| | | window.Viewer.entities.remove(this.localPoint) |
| | | this.localPoint = null; |
| | | } |
| | | |
| | | }, |
| | | //坡度分析 |
| | | setSlopeMap() { |
| | |
| | | // 设置贴地 |
| | | heightReference: Cesium.Color.CORNFLOWERBLUE.withAlpha(0.4), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | scale: 5.0, |
| | | scale: 1.0, |
| | | }, |
| | | }); |
| | | |
| | | this.setViewerFlyTo(position) |
| | | }, |
| | | setViewerFlyTo(entity) { |
| | | |
| | | window.Viewer.flyTo(entity, { |
| | | offset: { |
| | | heading: Cesium.Math.toRadians(0.0), |