With redraw (), the tiles are not requested again
See original GitHub issueHow to reproduce
- Leaflet version I’m using: 1.3.4
- Browser (with version) I’m using: chrome 40
- OS/Platform (with version) I’m using: window 10
- step 1
add tileLayer
var test=L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { maxZoom: 18, attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' + '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>', id: 'mapbox.streets' }).addTo(mymap);
- step 2
use redraw()
setTimeout(function(){ test.redraw(); },5000);
What behaviour I’m expecting and which behaviour I’m seeing
the tile are requested once if i use redraw(), the tiles should be requested twice
Minimal example reproducing the issue
` var mymap = L.map(‘mapid’).setView([51.505, -0.09], 13);
var test=L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
'<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
setTimeout(function(){
test.redraw();
},5000);`
- this example is as simple as possible
- this example does not rely on any third party code
Using http://leafletjs.com/edit.html or any other jsfiddle-like site.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Any way to refresh tiles? - Leaflet.GridLayer.GoogleMutant
Sometimes after map container resizes the tiles did not update, and the map is gray. Ia there a way to force reload/update the...
Read more >imageryProvider/ ImageryLayer redraw tiles - CesiumJS
I basically need a “refresh” method that requests the same tiles that are currently displayed and swaps them. I could reload the layer, ......
Read more >redraw - How to keep old tiles until each new tile is loaded ...
I'm using a combined tilelayer, which I have to refresh (using .redraw() currently) each time a new layer has been added or an...
Read more >Redraw/Refresh WMS layer in Leaflet - GIS Stack Exchange
Merges an object with the new parameters and re-requests tiles on the current screen (unless noRedraw was set to true).
Read more >Dynamic Layer does not redraw in IE/Firefox - rendering issues ...
I got some suggestions that this might be caused by the browsers' cache. Maybe some bug in the MapSuite code that sends the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try it , with a timestamp. But this may not be the best solution.
The tiles are kept in the browser cache and not re-requested.
There is currently no way to force a request in browsers without modifing the url (like append a version
?v=123
) which destroys chaching because of this I will close this issue and label it withwontfix
.