We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
采用如下写法:
<Map ref={map} widget={['NavigationControl']} enableScrollWheelZoom={true} center={center} > //下面的marker和label都正常 { marker && <React.Fragment> <Marker position={{ lat: marker.lat, lng: marker.lng }} onClick={({ type, target }) => { setIsModalOpen(true) }} /> <Label style={{ border: 1, padding: '5px' }} position={{ lat: marker.lat, lng: marker.lng }}> <p>{marker.name}</p> </Label> </React.Fragment> } //marker正常,label不正常 {deviceHistories.map((item, index) => ( <React.Fragment key={index + "history"}> <Marker key={index + "marker"} position={{ lat: item.lat, lng: item.lng }} icon={icon} /> <Label key={index + "label"} position={{ lat: item.lat, lng: item.lng }} > <p>{item.createdAt}</p> </Label> </React.Fragment> ))} ......
deviceHistories数组一开始为空,赋值后也一切正常,但是当我清空deviceHistories的时候,marker会消失,但是label不消失,而且奇怪的是第一段的marker和label都正常, 第二段的label却消失不了。 试过写成两个循环,也是一样的效果
一开始devicehistories为空
赋值
清空 ,marker消失了,label还在
The text was updated successfully, but these errors were encountered:
可以试一下 visiable props @jy1989
visiable
<Marker visiable={visiable}
Sorry, something went wrong.
visiable={visiable}
@jaywcjlove 改成这样还是一样 十分神奇
{ deviceHistories.map((item, index) => ( <React.Fragment key={index + "history"}> <Marker key={index + "marker"} position={{ lat: item.lat, lng: item.lng }} icon={icon} /> <Label key={index + "label"} position={{ lat: item.lat, lng: item.lng }} visiable={deviceHistories.length > 0} > <p>{item.createdAt}</p> </Label> </React.Fragment> ))}
不用label,用 CustomOverlay ,一切正常
No branches or pull requests
采用如下写法:
deviceHistories数组一开始为空,赋值后也一切正常,但是当我清空deviceHistories的时候,marker会消失,但是label不消失,而且奇怪的是第一段的marker和label都正常, 第二段的label却消失不了。 试过写成两个循环,也是一样的效果
一开始devicehistories为空
赋值
清空 ,marker消失了,label还在
The text was updated successfully, but these errors were encountered: