Closed onlyling closed 4 years ago
删除 Marker 是直接通过 改变 state 中的 markLocations 改变的么
删除 Marker 是直接通过 改变 state 中的 markLocations 改变的么
是的。
最新版已修复这些问题 注意 Overlay 不要用 View 包裹,Polyline 的属性有所调整
{markLocations.length >= 2 ? (
<Overlay.Polyline
stroke={width: 6, {color: 'FF727cf5'}}
points={markLocations}
/>
) : <View />}
需求说明
Marker
,点击已存在的Marker
删除它。Marker
用线连接。基础代码
问题/反馈
只有
Marker
添加/删除看起来没有问题
Marker
和Polyline
共存一直添加显示正常。
删除会有问题:
问题一:
Marker
,两个之间按顺序通过Polyline
连接起来;Marker
地图上会显示倒数第二个Marker
消失,最后一个保留,Polyline
显示正常,后面三个点连起来的;Polyline
显示正常,问题二:
Marker
,两个之间按顺序通过Polyline
连接起来;Marker
都还在,Polyline
全部消失;Marker
能添加,Polyline
不再显示;问题三:
偶尔在删除
Marker
的时候回触发红屏保存。问题四:
同一个种类的
Marker
显示也有问题,可能中间某个就不见了。设备