You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
[Android] Annotation do not open info when clicked #3584
@tobrun - @bleege put out a snapshot that included this fix. After testing, I'm still seeing that I cannot open marker annotations on the initial load without rotating the map first.
@bsudekum now by properly reading through your use-case I think the source of your problem can be found downstream rather than upstream. I have never saw this behaviour on Android GL before. I will do some debugging in react when I'm picking up nitaliano/react-native-mapbox-gl#249
@bsudekum
I wanted to take a look at this issue by debugging react-native, but I'm having trouble finding documentation for setting up my development environment to contribute to react-native. I have created this issue for nitaliano/react-native-mapbox-gl#252.
From looking at the React Native docs, it seems there're two possible ways to fix this, both within the ReactNativeMapboxGLModule class. Could you check if either of them help with this issue? (I'm sorry, I don't have a working React Native set up at the moment).
Option 1: Via the Application object.
getCurrentActivity().getApplication().registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
aPackage.getManager().getMapView().onCreate(savedInstanceState);
}
@Override
public void onActivityStarted(Activity activity) {
// see onActivityCreated
}
@Override
public void onActivityResumed(Activity activity) {
// see onActivityCreated
}
@Override
public void onActivityPaused(Activity activity) {
// see onActivityCreated
}
@Override
public void onActivityStopped(Activity activity) {
// see onActivityCreated
}
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
// see onActivityCreated
}
@Override
public void onActivityDestroyed(Activity activity) {
// see onActivityCreated
}
});
Option 2: Via the addLifecycleEventListener method.
reactContext.addLifecycleEventListener(new LifecycleEventListener() {
@Override
public void onHostResume() {
aPackage.getManager().getMapView().onResume();
}
@Override
public void onHostPause() {
// see onHostResume
}
@Override
public void onHostDestroy() {
// see onHostResume
}
});
Option 1 seems to be the better option as it includes the full cycle, not just a subset of it. Either way, I believe we should leave one of them in the code as not including these methods is a common source of errors in the SDK.
Activity
bsudekum commentedon Jan 16, 2016
Marker annotations are added here https://github.com/mapbox/react-native-mapbox-gl/blob/master/android/src/main/java/com/mapbox/reactnativemapboxgl/ReactNativeMapboxGLManager.java#L157
tobrun commentedon Jan 18, 2016
Linking #3573.
tobrun commentedon Jan 18, 2016
This should be resolved when #3573 lands.
Notice that this will be merged to the
release branch of 3.1.0and not on master.tobrun commentedon Jan 18, 2016
Landed with 74a9c50 on release branch of 3.1.0 in #3537.
tobrun commentedon Jan 19, 2016
@bsudekum also happy to report that #3156 will land with release of 3.1.0.
The related PR has some great improvements for touch handling on Android.
bsudekum commentedon Jan 19, 2016
@tobrun - @bleege put out a snapshot that included this fix. After testing, I'm still seeing that I cannot open marker annotations on the initial load without rotating the map first.
bleege commentedon Jan 19, 2016
Just noting that the SNAPSHOT with the fix is https://oss.sonatype.org/content/repositories/snapshots/com/mapbox/mapboxsdk/mapbox-android-sdk/3.1.0-SNAPSHOT/mapbox-android-sdk-3.1.0-20160119.193839-22.aar and it's based on the latest code in
release-android-v3.1.0branch.tobrun commentedon Jan 20, 2016
@bsudekum now by properly reading through your use-case I think the source of your problem can be found downstream rather than upstream. I have never saw this behaviour on Android GL before. I will do some debugging in react when I'm picking up nitaliano/react-native-mapbox-gl#249
tobrun commentedon Jan 20, 2016
@bsudekum
I wanted to take a look at this issue by debugging react-native, but I'm having trouble finding documentation for setting up my development environment to contribute to react-native. I have created this issue for nitaliano/react-native-mapbox-gl#252.
zugaldia commentedon Feb 3, 2016
@bsudekum I see that on Android
react-native-mapbox-gldoes not include the required activity lifecycle methods.From looking at the React Native docs, it seems there're two possible ways to fix this, both within the
ReactNativeMapboxGLModuleclass. Could you check if either of them help with this issue? (I'm sorry, I don't have a working React Native set up at the moment).Option 1: Via the
Applicationobject.Option 2: Via the
addLifecycleEventListenermethod.Option 1 seems to be the better option as it includes the full cycle, not just a subset of it. Either way, I believe we should leave one of them in the code as not including these methods is a common source of errors in the SDK.
/cc: @bleege @tobrun
bsudekum commentedon Feb 10, 2016
Option 1 gives the following error:
Option 2 gives the following error:
tobrun commentedon Mar 6, 2016
Closing this issue as this is an downstream issue in react-native rather than an Android SDK one.