Closed WeslleyNasRocha closed 5 years ago
How can i implement some markers when i click on them i know which one was clicked? I've tried with:
<Mapbox.ShapeSource id="marker-source" onPress={event => { console.log(event.currentTarget); }} shape={this.markers()} > <Mapbox.SymbolLayer id="marker-style-layer" style={{ iconAnchor: 'BOTTOM', iconImage: customMarker, iconSize: 0.3, }} /> </Mapbox.ShapeSource>
but every marker shows currentTarget === 77
currentTarget === 77
const feature = event.nativeEvent.payload; console.log(feature);
Not sure if this helps.
If you pass a property to the geoJSON, that property will be available in the payload.
How can i implement some markers when i click on them i know which one was clicked? I've tried with:
but every marker shows
currentTarget === 77