I am currently updating the version of OpenLayers version 2.13.1 with the new version of OpenLayers, OL3. My setup consists of Mapserver as the WMS mapping server and the previously mentioned OpenLayers client.
In the old system, I supported user interaction in such a way that if the user clicks on some part of the map, the map file is generated again, and as a result I force the layer to redraw to get some part of the map. Example code in version OL2:
$.ajax({ params: ... success: function (data) { if (data.success) { gisLayer.redraw(true); } } });
I want to get the same functionality in OL3, but there is no redraw function. I found two useful functions, but there are additional things to do the same functionality: - layer.getSource (). updateParams (params); as well as map.render ();
I also created a slightly more complex example in which I get the code to work, but requests for receiving WMS-plates contain an additional parameter as a key for receiving unique requests. Sample code above:
var params = layer.getSource().getParams(); params.t = getUniqueParam(); layer.getSource().updateParams(params);
Good. This is the situation I want to ask, is there any function that can make layers redraw without adding an additional parameter to WMS requests? AFAIK "problem" is that the browser cache images, and if the request is the same as before, the browser displays old images again.
Thanks for any help.
javascript openlayers openlayers-3
user2473933
source share