-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Issues when change map tiles URL dynamically #583
Comments
Hello, in #572 PR I implemented Leaflet's tile fetching / retaining strategy. Basicly if a Tile was loaded there is currently no way to force it to change Image based on new url while it is retained. Give me some time I'll make some changes to watch url changes. |
Great. This could be implemented as an option inside the For example: Great job, and thanks a lot! |
You can test it, just change your dependency and run
You will see the fade in animation (except if you provided |
Works perfectly! |
Using this fix causes flashing (A brief delay where the old image disappears completely, and the new one is not active). if the URL is changed frequently and tileFadeInDuration = 0. I would expect there to be no delay if the fade in is set to zero. The old tile should wait for a new tile to load and swap between them with zero blank time. |
I have the same problem as @moonag and I agree that this is an issue @johnpryan |
I'll take a look later today. @moonag @jesusrp98 I'm a bit confused what should happen if forinstace there are 9x tiles loaded on screen and if you change the URL then old tiles should be visible until new ones aren't downloaded (for simplicity user isn't panning / zooming while Tiles are downloading), assume 6x tiles download very fast so they will be shown asap but 3x is still in downloading phase, SO you will see old and new tiles as mixed. |
I get what you're saying @maRci002. The thing is that in earlier versions of this plugin, when you change the tile URL, the screen wouldn't flash the background color. It will simply apply all the updated tiles. So the right behaviour should be just to wait untill all visible tiles are downloaded, and then display the new ones. You could check this behaviour in |
Just to clarify, each tile is loaded individually and replaced individually. @maRci002 @jesusrp98 . The issue is that the tile flashes the background color (transparent) for a brief time when the new one is switched out with this fix. Pre 0.9.0 behavior would be to switch out the tiles instantly without the tile briefly disappearing before the new one appears. This is true even if the fade in delay is set to zero. You can create this by having 2 url layers switch quickly between each other and see the blank frames. It does apply to the whole screen, but individual tiles blank before the new one is shown. When you change the URL, the tile should wait for the new one to load in and then show the new one; but still keep the old tile visible. |
I'm pretty sure in
I'll implement this behavior. |
Nice! Looking forward to test it! |
@maRci002 I tested it out. Behaves exactly as intended. There does not seem to be an issue if a tile url is swapped before it is fully loaded It always shows the old one which is preferred. It is exactly as intended! You are insane! This should be a PR as it adds improvements tile fetching behavior. |
It is actually a PR see #584 . |
First thing, congratulation! The v0.9.0 release include really nice features!
Since this new update, when I try to change the map tiles URL while running the app, it takes a couple seconds, after to start navigating the mapo with the finger, until all tiles are updated. Before, this change was instantly performed.
Here's how I change the URL dynamically:
Is this a bug, or is there a better method to update the map URL, for example using the
MapController
class? Thank!The text was updated successfully, but these errors were encountered: