0

I have a Mapguide layer as an ImageLayer in an OpenLayers map. Using the Mapguide api, I make changes to the Mapguide layer. The changes to the layer aren't reflected in the OpenLayers map until it's zoomed. Panning has no affect. Have tried various things as suggested here: https://openlayers.org/en/latest/doc/faq.html#how-do-i-force-a-re-render-of-the-map- like.

map.render(); and
map.renderSync();

mgLayer.getSource().refresh(); doesn't work either

Does anyone know if there is a way to do this?

ouflak
  • 2,458
  • 10
  • 44
  • 49
gbneff
  • 11
  • 3
  • If there are changes on a data server and there is no change to the client setup a refresh would have no effect if reads from browser cache. One way to override browser cache is to add/update a dummy parameter on the request url, such as a timestamp. – Mike Nov 18 '21 at 23:29
  • This worked: var source = mgLayer.getSource(); var params = source.getParams(); params.t = new Date().getMilliseconds(); source.updateParams(params); Thanks for the tip! – gbneff Nov 19 '21 at 23:38

0 Answers0