1

I develop a map with live data. The data is stored in a PostGIS (PostgreSQL) database. Geoserver is used to provide the WMS.

My problem is that I need to redraw my layer, let's say, every 5 seconds to see changes of the data. The most common way seems to be something like this:

window.setInterval(function(){
    var params = source.getParams();
    params.t = new Date().getMilliseconds();
    source.updateParams(params);
    source.refresh();
    window.setTimeout(function(){
    map.updateSize();},200);
}, 5000);

Unfortunatelly it does not work for me. New data is shown only if I zoom or move the map. I cannot see GET requests from the browser.

How can I update my map?

  • 1
    please expand on what doesn't work - are new requests made or does the browser cache get in the way? – Ian Turton May 16 '17 at 15:12
  • looks like your setting the refresh rate but you need to execute the action like window.setInterval(reload, 10000); – Mapperz May 16 '17 at 15:14
  • @iant For me it looks like no GET request is send. – Dark Foo May 16 '17 at 15:25
  • @Mapperz This is not the problem. It is similiar to this – Dark Foo May 16 '17 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.