-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: first instance of the map overlaps everything when have another map in a different scene. #453
Comments
I filed a ticket for this , both here and in RNRF git, folks are taking it easy , i rolled back to rn 28 thanks |
@jeveloper thanks, I just was able to do it with changing my second scene type to: type="replace" Not the best solution as it removes the smooth transition, but works! |
Yeah i did observe that , but obviously when you want to stack navigation and want to have to a back arrow , it won't work. |
I have the similar issue with second screen and frozen, unresponsive, map. Using NavigationExperimental and RN 0.28 |
@morrigan i believe 29 or 30 has a fix for it. |
I'm having this same issue on a project that uses Adding |
@danscan can you confirm which version of rnrf you're using , latest is 34 and which RN thanks |
@jeveloper Sorry for the delay. I'm using |
No problem @danscan , let me know if latest RNRF will work |
@jeveloper Updating to |
I've narrowed down odd map overlay behavior to this PR: #363. Before this PR maps work fine, after I'm getting odd overlay behavior. This is running react-native 0.28 and RNRF 3.34.0. I'm going to try to pull out this commit and patch on top of maps 0.7.1 and see if I can get things working ok in 0.29.2. |
Thanks @olegpesok , Spasibo |
@jeveloper I won't even pretend to understand enough Android dev to say why these things are related, but I DID manage to fix the problem here: olegpesok@030ea04 This is running RNRF 3.34.0, RN 0.29.2, and react-native-maps 0.7.1 (with my patch). This isn't production quality at all. I can imagine all sorts of ways this would break in a real app, but for my test case it did resolve the issue. Maybe someone more knowledgeable can figure out a more permanent fix. In your
Make sure to use local build of react-native-maps in
|
@olegpesok - I got this to work on RN 0.31 with one minor change. I kept the reactContext.getBaseContext() as an argument for new AirMapManager() in MapsPackage.java. Great job! I would love to know more about what you believe needs to be done to use this in production..? Or is there perhaps someone else around that knows more about Android development that could tell what risks or issues this solution could lead to..? |
@pellepersson Well, I'm basically creating a singleton that's holding a reference to the main activity as long as the app is running. Ideally you need to remove that reference whenever the main activity needs to be 'unmounted' or you risk memory leaks. I think for most simple RN apps thats not an issue since the main activity is probably the only activity and will exist as long as the app is running. |
Hey Oleg and @pellepersson , awesome, thats a small change :) |
Seems that react-native is getting |
Check this out, someone made a pull request |
Hey guys, any update on this issue? Is there a workaround? |
@veedeo I hope they'll take in pull requests that are pending, not much support for this project for some reason :( |
Today we tried to run the pull request that @jeveloper is linking to ([https://github.com//pull/449/commits/5187d4f33aea0009363f72ae4aaacc9b0d7829c7]) and the map view feels a bit more light weight now compared to the other solution we are discussing above. |
Hey @pellepersson , what do you mean by feels a bit more light weight? , less memory use? thanks |
@jeveloper - yes I was thinking about the memory usage. multiple mapviews works for both solutions. |
@pellepersson greate news, can you check if this solves swiping issues with a MapView beeing placed into scrollable container. In my case its a RNRF component with direction="vertical", but maybe placing it into a scrollview will show same problems |
@pellepersson thank you for confirming that. I wonder when folks on this project will start accepting pull requests, they seem to ignore it |
@veedeo - sorry, but I don't have time for that. It is not that hard to do it yourself though... just refer to the pull request in your app's "package.json":
and do what @olegpesok describes above to make sure it is the local build that is being compiled in "app/build.gradle":
|
We think this may be fixed by this PR that was just merged: #449. Perhaps you can verify? |
@olegpesok @pellepersson Hey guys, it feels like im the guy that connects issues , pulls and provides context. Hope this issue will resolve multiple mapviews between navigations. Thanks |
@jeveloper I do have multi maps in my proj to, how can I test this merge? |
@veedeo I want to clarify that this issue is officially fixed in branch 0.11 ,0.12 and 0.10.x Folks, i recommend adding enablling loader for android, there are crash reports if android itself + google map services did not load component in memory itself , then your app logic will attempt to modify something that's still null or not fully loaded. |
bump |
does this branch "fdnhkj/react-native-maps" solve your issue? |
@joshualcoffee i had the same issue { currentRoute === 'grounds'
? <Map objects={filteredGrounds} fetching={fetching} />
: null
}
|
That will not work in all use cases. The best example I have is showing children of the same object type. Lets say I have a "person" model that can be the child or parent of another person. If i want to render a modal (or something along those lines) with the same component on top of the screen the issue will still happen. The only work around I could see is to have an internal state on each component that checks to see if the parent is visible. However it gets ugly because you have to pass aroudn actions and events to handle the internal state. |
@joshualcoffee I have a same problem. How to slove this?? |
Facing same issue me too... on switching screens previous screen map is still there on top of new screen map.
Can anyone provide me solution of it. I think it is best if there is any option for destroy previous map at the time of switching screen. |
If you are using redux you can solve this by creating a map container that has a state to render the map or not. The idea is to have a flag with the screen name and unique identifier. So for us we used something like This allowed us to use modals and other type of screen renderers without it interfering with the underlying code. |
This issue was fixed but there was a regression in version 0.13.1 (see #1161 for details) Please try downgrading to 0.13.0 to see if that fixes the issue. |
Thanks @ryankask 👍 It's working with 0.13.0. Hope it will resolve in next release :) |
Hey guys, |
Same issue here:
|
same issue |
@christopherdro oh cool! I'll try it as soon as i get back to the project and let you know :) Thanks! |
@christopherdro I tried your solution and seems to fix the issue :) |
The problem still occurs on Android 6.0.0 (API 23). Can someone please test with Android 6 and report? react-native: 0.45.1 Device: Genymotion Google Nexus 5X - 6.0.0 API 23 |
@scotbond You need to modify your package.json file to specify the latest commit as below: I did the same and it resolved from me. |
I have same problem & following @joshualcoffee's suggestion did fix it. |
This still occurs for me.
I tried on multiple versions. 5.1.0 - Genymotion => NG |
Still having the same issue, any solution? |
@fcabrera23 me too!! We need a solution!!! |
@fumiki did you solve the problem? I have already tried all suggestions above, but none worked. |
@fcabrera23
this.state.isFocused is boolean for the screen is focused or not.
|
Hi guys,
I know you have lots of issues already to work on, but here is another one.
I'm using RN 0.31 with latest maps and was finally able to get my map to show up on Android with a Browser Key.
I also use react-native-router-flux and I have two scenes with maps. When I switch to the second scene, the map from the first one is frozen on top of it. I can tap/drag the map behind it and everything, but can't see what I am tapping because of this lag. If I remove the map from the second screen - everything works fine.
Any ideas or workarounds?
Thanks,
Alex.
The text was updated successfully, but these errors were encountered: