Fixed onMapReady event on iOS to resemble onMapReady on Android#1797
Merged
christopherdro merged 1 commit intoreact-native-maps:masterfrom Nov 28, 2017
Merged
Conversation
react-native-maps#1793) Also: Closes react-native-maps#1776, Closes react-native-maps#1696, Closes react-native-maps#1680, Closes react-native-maps#1605) Probably closes more issues related to iOS, panning and scrolling.
danielgindi
commented
Nov 17, 2017
| - (void)mapViewDidFinishRenderingMap:(AIRMap *)mapView fullyRendered:(BOOL)fullyRendered | ||
| { | ||
| [mapView finishLoading]; | ||
| [mapView cacheViewIfNeeded]; |
Contributor
Author
There was a problem hiding this comment.
This was also an issue: cacheViewIfNeeded is called on finishLoading also, which is a tremendous overhead that is not necessary.
As caching an image is a CPU and RAM consuming job.
Contributor
There was a problem hiding this comment.
Hi, I'm sorry to say but this commit is quite flawed. It creates a global variable called didCallOnMapReady which once set to YES is never reset to NO. This breaks onMapReady quite badly, causing it now to only fire on the first rendered MapView and after that never again (not when MapView is unmounted/mounted, or for any other MapViews).
christopherdro
approved these changes
Nov 28, 2017
pinpong
pushed a commit
to pinpong/react-native-maps
that referenced
this pull request
Feb 28, 2025
react-native-maps#1793) (react-native-maps#1797) Also: Closes react-native-maps#1776, Closes react-native-maps#1696, Closes react-native-maps#1680, Closes react-native-maps#1605) Probably closes more issues related to iOS, panning and scrolling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Closes #1793)
Also: Closes #1776, Closes #1696, Closes #1680, Closes #1605)
Probably closes more issues related to iOS, panning and scrolling.
The issue is that on Android, the onMapReady comes from the native onMapReady event, which occurs when Google Play Services first provides a Google Maps view.
But on iOS - it happened whenever rendering has finished - which is a completely different interpretation, and misses the point of just doing the initial stuff like
initialRegion/region.