diff --git a/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java b/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java index 1cb60d6..ff10af9 100644 --- a/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java +++ b/android/src/main/java/com/google/android/react/navsdk/MapViewFragment.java @@ -113,7 +113,7 @@ public void onRecenterButtonClick() { @Override public void onMarkerClick(Marker marker) { - emitEvent("onMapReady", ObjectTranslationUtil.getMapFromMarker(marker)); + emitEvent("onMarkerClick", ObjectTranslationUtil.getMapFromMarker(marker)); } @Override @@ -138,7 +138,7 @@ public void onGroundOverlayClick(GroundOverlay groundOverlay) { @Override public void onMarkerInfoWindowTapped(Marker marker) { - emitEvent("onInfoWindowClick", ObjectTranslationUtil.getMapFromMarker(marker)); + emitEvent("onMarkerInfoWindowTapped", ObjectTranslationUtil.getMapFromMarker(marker)); } @Override diff --git a/android/src/main/java/com/google/android/react/navsdk/NavViewFragment.java b/android/src/main/java/com/google/android/react/navsdk/NavViewFragment.java index a1e7bc6..57ad854 100644 --- a/android/src/main/java/com/google/android/react/navsdk/NavViewFragment.java +++ b/android/src/main/java/com/google/android/react/navsdk/NavViewFragment.java @@ -125,7 +125,7 @@ public void onRecenterButtonClick() { @Override public void onMarkerClick(Marker marker) { - emitEvent("onMapReady", ObjectTranslationUtil.getMapFromMarker(marker)); + emitEvent("onMarkerClick", ObjectTranslationUtil.getMapFromMarker(marker)); } @Override @@ -150,7 +150,7 @@ public void onGroundOverlayClick(GroundOverlay groundOverlay) { @Override public void onMarkerInfoWindowTapped(Marker marker) { - emitEvent("onInfoWindowClick", ObjectTranslationUtil.getMapFromMarker(marker)); + emitEvent("onMarkerInfoWindowTapped", ObjectTranslationUtil.getMapFromMarker(marker)); } @Override diff --git a/example/src/App.tsx b/example/src/App.tsx index 4fa77ab..b9afe05 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -17,6 +17,7 @@ import * as React from 'react'; import { NavigationContainer, + useIsFocused, useNavigation, type NavigationProp, } from '@react-navigation/native'; @@ -37,15 +38,20 @@ export type StackNavigation = NavigationProp; const HomeScreen = () => { const { navigate } = useNavigation(); + const isFocused = useIsFocused(); + return ( -