googlemaps / react-native-navigation-sdk

React Native library (Beta) for bringing Google Navigation SDK to Android and iOS apps using React.
https://www.npmjs.com/package/@googlemaps/react-native-navigation-sdk
Apache License 2.0
31 stars 7 forks source link

MapViewCallbacks onMarkerClick triggers onMapReady #321

Closed liuyongAlive closed 3 weeks ago

liuyongAlive commented 3 weeks ago

Environment details

  1. MapViewCallbacks onMarkerClick triggers onMapReady,not onMarkClick
  2. Android & react-nnative-navigation-sdk v0.8.0

Steps to reproduce

1 using MapViewCallbacks onMarkerClick

Code example


onMapReady: () => {
     // click marker still output this
    console.log("onMapReady", mapViewController);
  },

onMarkerClick: (marker) => {
    // click marker not work
    if (marker) {
      console.log("onMarkerClick", marker);
    }
  },

Stack trace

# example

I'm not very good at java, and I suspect it's a mistake in this place. https://github.com/googlemaps/react-native-navigation-sdk/blob/8c7f56999157988c38d65f0f590413513dc64ca3/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java#L115-L117

as the same, I think this has same mistake

https://github.com/googlemaps/react-native-navigation-sdk/blob/8c7f56999157988c38d65f0f590413513dc64ca3/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java#L139-L142