Refresh WMS tiles

37 views
Skip to first unread message

Andreas Ekstrand

unread,
Apr 17, 2017, 9:35:37 AM4/17/17
to Leaflet
Hi,

I'm using Leaflet together with QGIS Server, creating a TileLayer.WMS pointing to qgis_mapserv.fcgi.exe. It all works like a charm, except for the fact that I can't manage to refresh the tiles when having changed the layer symbology server-side.

I have tried adding a random query argument to the layer URL in order to make it unique so that it's reloaded, and I actually see new tiles loading in Chrome's Network console. I also disable browser caching in same Network console. But the current level will stay as it was until I refresh the page. Other zoom levels are updated though, so when I zoom in and out they are correct.

I have tried calling redraw on the layer, explicit removeAllTiles and update, as well as setting its _tiles to an empty list - to no avail.

How can I force the current tiles to be reloaded? And how do I find out which caching that is the culprit? Anything specific in Leaflet, my browser or in QGIS Server?

/Andreas

Arnie Shore

unread,
Apr 17, 2017, 11:25:23 AM4/17/17
to leafl...@googlegroups.com
Have you looked at Server-Sent-Events (https://en.wikipedia.org/wiki/Server-sent_events) and the Leaflet redraw() function?

Andreas Ekstrand

unread,
Apr 17, 2017, 1:58:42 PM4/17/17
to Leaflet
Thanks, but I already know on the client when to refresh the layers, it's just that refreshing doesn't work. I can see the map redrawing but it obviously uses the same tiles. Any suggestions for further investigation are appreciated!
Reply all
Reply to author
Forward
0 new messages