react-native-maps: Coordinate property missing iOS GoogleMaps in MapView.Marker onPress
Is this a bug report?
Yes
Have you read the Installation Instructions?
Yes
Environment
react-native-maps@0.17.1 react: 16.0.0 react-native: 0.50.3
Target Platform: iOS 11.1.2 iPhone 6S Map: GoogleMaps
Steps to Reproduce
- Add a MapView.Marker to a MapView
- Add a
onPressprop to the MapView.Marker - In the callback function the value of the event’s
nativeEvent, thecoordinateproperty is missing.
Expected Behavior
I expected to see a coordinate property in the event object.
Actual Behavior
The coordinate property is non-existent. If I remove the map provider and use AppleMaps then the coordinate value shows, GoogleMaps (our required platform) returns no coordinate property.
Reproducible Demo
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (2 by maintainers)
~~@rborn Doesn’t appear to be rendering. Any ideas? Created a snack: https://snack.expo.io/BJFFEhi4z~~ Sorted (
coordinateneeded to be singular). Thanks so much for your help! I’ll leave the report open as I assume this is something that needs fixing, but if you feel it would be better off closed as this is a very simple workaround, feel free to do so.@rborn yes.
@FaBeyyy That’s because in my example I just return
coordinatefrom theonPressinside my custom marker. Here I fixed it for you in this Snack: https://snack.expo.io/B1Rv4jxrz@jskidd3 something like this (untested/pseudocode):
and in your file you use
MyMarkerinstead ofMapView.Marker. Makes sense?