-
Notifications
You must be signed in to change notification settings - Fork 697
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
[ANDROID] tile is stuck but annotations moves #798
Comments
@GuillotJessica can you post a video? I'm not sure I follow |
Thanks for the help[ |
@GuillotJessica Do you happen to have multiple navigatorScreens with mapbox maps nested within the same stack? If so, I think its an issue I encountered that I can't fully reproduce. There seems to be an issue where if you run two maps at the same time nested in a StackNavigator, the bottom most map will render at the top of the one in the current stack (while the top map receives touch input), giving it the appearance of being stuck. This only happens on Android. Could this be your issue? |
Here's my entire navigation
|
Hello, @nitaliano |
I believe I know what's happening it could be due to the GLSurfaceView. React Native runs in one Activity on Android, and multiple GLSurfaceViews cannot be placed on top of each other on Android in the same Activity. Something like react-native-navigation or native-navigation would avoid these issues. One thing I am curious about is what happens if you add a key to your map component that never changes? |
give me a snippet, I'd love to give it a go |
Except that the annotations inside theMapboxGL.MapView are still moving |
@GuillotJessica |
Just to chime in, my workaround was to set the underlying map (at the bottom of the stack) to position absolute when an additional map at the top of the navigation stack is shown. |
I only have one map @kristfal and compass, annotation are still working fine |
here's my new versions |
@GuillotJessica have you tried adding a key to the MapView? |
@GuillotJessica @nitaliano I have tried and nothing changes. I'm experiencing a similar issue, in my case I have two distinct maps in a different tabs and the maps are overlapped when I switch between them. This issue is only happening on android and I'm using pure javascript navigator. |
@nitaliano there is no key props possible MapViewDoc send me a snippet and i'll reproduce |
@GuillotJessica key is a React property https://reactjs.org/docs/lists-and-keys.html @hernanmateo I would try with what @kristfal suggested, the JS navigator is making the GLSurfaceView's overlap which is not possible on Android |
thx @nitaliano
the problem remain |
Hello @nitaliano, I just tested this issue using wix/react-native-navigation and the overlapping problem persists. |
@nitaliano any improvements on the way? |
Just to add some troubleshooting help, I've experienced this issue with |
thx @lucasgray just have to find a way to make this work |
Hello @nitaliano, any news on this issue? I think it's one of the main problems of this library since it is usual to use multiple maps in an application. Thx |
@hernanmateo The problem is it needs to be a new activity since two GLSurfaceViews cannot be overlapped on Android. React Native runs in a single activity so when using JS based navigators you're trying to overlay two GLSurfaceViews on top of each other and they battle for z-index and all of the views on top of them just get thrown to the top. What I would recommend doing especially with the JS based routers, is have one MapView that renders different things based on route |
Thank you @nitaliano, in my case I'm not using a JS based navigator but I'm using a native navigator solution and I'm having this issue by switching between two screens with the bottom tab bar. So, we have to assume, in the medium term, that this behavior is going to stay that way? |
@hernanmateo When you switch between screens is there a way for your screen on the bottom of the stack to null out the map view? Also I just looked at react native navigations code and it is not pushing on an Activity or Fragment in the tab case at least. The bottom GLSurfaceView needs to be removed from the view tree or position absolute off the screen @kristfal mentioned this above #798 (comment) There is nothing this repo can do until the navigators in react native start handling things the way a real native application would handle them. The best that we can do is write a component on top of MapboxGL.MapView that is able to know if it's not displayed and hide itself I will try to put together sometime so I add a working demo application with react-navigation and react-native-navigation that has multiple maps in it |
+1. now I render the map in a way like |
Hi @nitaliano I have test a couple of workarounds with success but the results don't convince me. How about to enable the TextureMode option and the zOrder setting as @tobrun suggest in this issue? |
Hello again, Example usage: <Mapbox.MapView
ref={(c) => this._map = c}
[...]
textureMode={true}
> |
@hernanmateo PR will address this issue and we will work on getting it merged in to fix this problem. Multiple TextureViews can be stacked on top of each other, at the cost of performance but I don't expect this to be an issue for majority of the use cases we'll run into on RN. I just checked to make sure we'll keep support for this in future versions of the RN SDK there are plans on it being supported for sure through 5.x.x and 6.x.x SDK versions, so this can be a long term solution. |
TextureView support has been merged in I'll publish another RC today so I recommend everyone having this issue to try it out it should be fixed |
|
I've got this trouble here stackoverflow
my map is displayed in a screen with annotations and callout, every thing is working fine except the map who is stuck, the compass moves, everything works but the tile
Callout respond to a stackNavigation which seems to be the problem
The text was updated successfully, but these errors were encountered: