Skip to content
New issue

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

Marker's onPress doesn't return nativeEvent.position on iOS #4996

Open
melyux opened this issue Mar 10, 2024 · 1 comment
Open

Marker's onPress doesn't return nativeEvent.position on iOS #4996

melyux opened this issue Mar 10, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@melyux
Copy link

melyux commented Mar 10, 2024

Summary

The event from onPress for a Marker doesn't return the position field that's supposed to be inside e.nativeEvent on iOS. This is returned only on Android.

This bug is further evinced on Stack Overflow.

Reproducible sample code

<Marker
  ...
  onPress={(event) => {
   console.log(event.nativeEvent)
  }}
/>

Steps to reproduce

  1. Use this project on iOS.
  2. Specify an onPress for a Marker
  3. See that the event's nativeEvent does not return a position, only coordinates. (it should return both, per the docs)

Expected result

nativeEvent should return a position value.

Actual result

nativeEvent does not return a position value on iOS.

React Native Maps Version

1.10.3

What platforms are you seeing the problem on?

iOS (Google Maps)

React Native Version

0.72.4

What version of Expo are you using?

SDK 48

Device(s)

iPhone 15 Po

Additional information

No response

@melyux melyux added the bug Something isn't working label Mar 10, 2024
@mateki0
Copy link
Collaborator

mateki0 commented Mar 10, 2024

Hi @melyux, thanks for reporting this. I think this is a mistake in the documentation because this marker uses GMSMarker underneath and his position property type is CLLocationCoordinate2D. This type has only latitude, longitude and animatableData.

Sources:
https://developer.apple.com/documentation/corelocation/cllocationcoordinate2d
https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_marker#property-documentation

@jan-kozinski jan-kozinski added the good first issue Good for newcomers label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants