-
Notifications
You must be signed in to change notification settings - Fork 121
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
added setStyle method on map controller #431
Conversation
I am not a maintainer, but I have updated the style simply by passing a new style into the map itself - does this not work for you? |
I understand that directly passing a new style to the map widget seems convenient. However, this approach requires rebuilding the entire map, which can cause a performance hit due to dismissal and re-initialization. |
This is not only convenient, but the standard way of interacting with and building widgets in flutter. If you look closely at what happens under the hood, you will actually notice that it does in fact not rebuild the entire view from scratch. The view for both iOS and Android is created the first time you build the map widget. Afterwards, passing in new styles just updates these views. In profile mode, the first time the map builds one can observe raster times times up to 16ms on a Galaxy S20, when I refresh the style, the times do not go above ~4ms. Please correct me (or the maintainers) if I have gotten something wrong. I do see however the setStyleString method and it not being used anywhere ... So up to the maintainers to decide 👍 😄 |
Thank you for your pull request @itheamc. I agree that @smallTrogdor Thanks for joining the discussion. It a nice find that you can simply swap out the widget parameter and let flutter do the rest. Although there are two reasons I'd like to add this functionality.
|
Sure, I'll create a new pull request with well-defined commit messages for better tracking. |
Alright, thanks for the insight! 👍 |
Closing this pr in favor of you new pull request. #433 |
No description provided.