Same Marker always clicked
monski opened this issue · comments
Raymund commented
Hi I got some weird problems.. im always clicking the marker at location 0,0
usually i have 10 at the last data it has lat and lng of 0,0 and each marker i click it was default their.. thanks
<Gmaps
ref="gmaps"
params={MapParams}
width={'auto'}
height={'600px'}
lat={this.state.defaultPoints.lat}
lng={this.state.defaultPoints.lng}
onMapCreated={this.onMapCreated}
zoom={this.state.gmapsZoom}>
{resultdata.length > 0 ? (
resultdata.map((g,i) => {
let onClick = () => {
this.toggleInfoModal(g)
}
return (<Marker onClick={onClick} zIndex={100 +i} key={`maps-${i}`} lat={g.lat} lng={g.lng} />)
})
) : null }
</Gmaps>
Michele Bertoli commented
Hello @monski
I'm not sure I understand the problem
Can you please give me more information?
Thanks!
Raymund commented
Hi Michele,
thanks for the reply, please consider this as close...close, i did fix now my problem.. what i did is clear previous marker before putting new marker again..
Thanks