Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

标绘功能中画圆结束时出错 #104

Closed
hmilyyang opened this issue May 27, 2022 · 1 comment
Closed

标绘功能中画圆结束时出错 #104

hmilyyang opened this issue May 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hmilyyang
Copy link

看报错信息是因为this._delegate.polygon.hierarchy,对于Circle没有polygon这个属性
尝试将EditCircle.js中_mountedHook函数修改如下可以解决问题:
_mountedHook() {
this._radius = this._overlay.radius
this._center = Transform.transformWGS84ToCartesian(this._overlay.center)
this._positions = [].concat([
this._center,
this._computeCirclePoints(this._center, this._radius)[0]
])
this._delegate.position = new Cesium.CallbackProperty(() => {
return this._positions[0]
})
this._delegate.ellipse.semiMajorAxis = this._delegate.ellipse.semiMinorAxis = new Cesium.CallbackProperty(() => {
if (this._positions.length > 1) {
this._radius = Cesium.Cartesian3.distance(
this._positions[0],
this._positions[1]
)
if (this._radius <= 0) {
return null
}
return this._radius
} else {
return null
}
})
this._layer.entities.add(this._delegate)
}

cavencj added a commit that referenced this issue May 28, 2022
@cavencj
Copy link
Member

cavencj commented May 28, 2022

已修复 ,下个版本发布

@cavencj cavencj added the bug Something isn't working label May 28, 2022
@cavencj cavencj closed this as completed May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants