Skip to content
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

Refresh map tiles #21

Closed
aurelientymate opened this issue Jan 25, 2021 · 7 comments
Closed

Refresh map tiles #21

aurelientymate opened this issue Jan 25, 2021 · 7 comments

Comments

@aurelientymate
Copy link

Hi, is there a way to force refresh the map tiles. Right now, i use redrawTiles when i need a refresh. But it's only trigger a refresh on map zoom/dezoom or on map movements.
So, is it possible to force redraw tiles when the function is called ?
Thanks

@p-lr
Copy link
Owner

p-lr commented Jan 25, 2021

Hi, I'd like to better understand your need.
At some point, the tiles change even when not panning or zooming, and you'd like to trigger a reload of all visible tiles. Is that correct?
This is something that could be implemented in a future version.

@aurelientymate
Copy link
Author

Yes, i would like to refresh all visible tiles on button click. As if on a real map, you would like to go from plan to satellite view for example.

@p-lr
Copy link
Owner

p-lr commented Jan 26, 2021

I see. I do the exact same thing in my own trekking app. Do do that, I destroy the existing MapView and add a new one to the view hierarchy using the same id. This way, new tiles are displayed while the new MapView has its state automatically restored using the state (zoom, pan) of the former MapView.

So, what I'm saying is: it's already possible using a not-so-handy technique.
A redrawTiles() would be handy, and I'll see what I can do.

@aurelientymate
Copy link
Author

I used your method, destroying the map and add a new one with the same id works for me. Thank you for your help.
Great job on this lib

@p-lr
Copy link
Owner

p-lr commented Feb 3, 2021

@aurelientymate
Hi, FYI the new 2.1.6 version has a redrawTiles() method on MapView that should work as you expect.

@aurelientymate
Copy link
Author

It works perfectly, exactly what i needed. Great job ! Thanks 👍

@p-lr
Copy link
Owner

p-lr commented Feb 4, 2021

Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants