Conversation
修复 Issue #2714: 线图层shape默认line,切换到arc,再切回来,图层消失 问题原因:当调用 layer.shape() 方法改变 shape 时,没有触发模型重建。 解决方案:重写 rebuildModels 方法,在 shape 改变后调用 buildModels 重建模型。
|
There was a problem hiding this comment.
Code Review
This pull request adds a rebuildModels method to LineLayer. However, as noted in the review, this implementation is redundant because the base class BaseLayer already provides the same functionality, and the method should be removed to simplify the codebase.
| public async rebuildModels() { | ||
| await this.buildModels(); | ||
| } |
问题
修复 Issue #2714: 线图层shape默认line,切换到arc,再切回来,图层消失
原因
当调用
layer.shape()方法改变 shape 时,没有触发模型重建。解决方案
在 LineLayer 中重写
rebuildModels方法,类似于 PointLayer 的做法,在 shape 改变后调用buildModels重建模型。测试