Skip to content

react-amap CircleEditor active 失效 #250

@zxh0125

Description

@zxh0125

我在reaact map遍历显示Circle组件与 CircleEditor组件
代码如下:

{saveOrUpdateVO?.local_deliver_region_list?.map((region_list, index) => {
console.log(index === local_deliver_index)
return region_list?.region_type === 'RADIUS' ? (
<Circle
key={index.toString()}
bubble={false}
center={markerCenter}
radius={bignumber(Number(region_list?.region_radius * 1000), 2)}
visible={regionInfo?.active || false}
style={AREACOLOR[index]}
z-zIndex={index * 10}
draggable={false}
>
<CircleEditor events={index === local_deliver_index ? circleEvents(saveOrUpdateVO) : undefined} active={index === local_deliver_index} />

) : (
<Polygon key={index.toString()} path={memoPolygonLongit(region_list.local_deliver_geo_list)} z-zIndex={index * 10} style={AREACOLOR[index]}>
<PolyEditor active={index === local_deliver_index} events={polygonEvents} />

)
})}Ï
打印的active都是fasle。
具体需求。增加区域同时增加一个Circle组件。同时删除一个区域相对应Circle组件也删除。但是发现删除后CircleEditor还在。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions