fix(measure):修改量测中间点计算方式和贴地多边形坐标获取错误tags/4.0.0
| import { Cesium } from '../../namespace' | import { Cesium } from '../../namespace' | ||||
| export default function midCartesian(start, end) { | export default function midCartesian(start, end) { | ||||
| let c1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(start) | |||||
| let c2 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(end) | |||||
| let cm = new Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5) | |||||
| return Cesium.Ellipsoid.WGS84.cartographicToCartesian(cm) | |||||
| return Cesium.Cartesian3.midpoint(start, end, new Cesium.Cartesian3()) | |||||
| } | } |
| ...this._style, | ...this._style, | ||||
| hierarchy: new Cesium.CallbackProperty(() => { | hierarchy: new Cesium.CallbackProperty(() => { | ||||
| if (this._positions.length > 2) { | if (this._positions.length > 2) { | ||||
| return new Cesium.PolygonHierarchy(this._positions) | |||||
| return new Cesium.PolygonHierarchy( | |||||
| this._positions.map((item) => item.clone()) | |||||
| ) | |||||
| } else { | } else { | ||||
| return null | return null | ||||
| } | } |
| */ | */ | ||||
| start(measure, options) { | start(measure, options) { | ||||
| this._startHook(measure, options) | this._startHook(measure, options) | ||||
| this._startLabel.label.heightReference = | |||||
| Cesium.HeightReference.CLAMP_TO_GROUND | |||||
| this._resultLabel.label.heightReference = | |||||
| Cesium.HeightReference.CLAMP_TO_GROUND | |||||
| new DrawPolyline({ | new DrawPolyline({ | ||||
| material: options.material || Cesium.Color.YELLOW.withAlpha(0.6), | material: options.material || Cesium.Color.YELLOW.withAlpha(0.6), | ||||
| depthFailMaterial: | depthFailMaterial: |