[mapserver-users] Programmatically refresh the current view

Lime, Steve D (MNIT) steve.lime at state.mn.us
Wed Jul 17 14:51:12 PDT 2019


This isn't a MapServer issue per se. I mean MapServer isn't caching anything. If I understand your question you could bust the browser cache by adding another parameter to the call to mapserver - something to make each map call unique even if the layers and extent don't change. Just tagging on the current unix timestamp would do it (e.g. &_timestamp=134232523).

________________________________
From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> on behalf of Jerry Faust <jerryfaust1 at gmail.com>
Sent: Wednesday, July 17, 2019 1:12:36 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Programmatically refresh the current view


This message may be from an external email source.
Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center.



Hello all.


We have set up MapServer using MS4W, running against IIS.  We have a .map file defined to include about a dozen layers contained in an ESRI GDB format.



All of this works fine for the initial load of the map, but following any data changes, we would like to be able to force a refresh of the map without having to reload the entire page.  For example, if we simply drag/pan the map, the layers will refresh with the latest data using the current zoom-level/extents; but we would like to programmatically refresh the view when data has changed.


Up to this point we have exhausted what we feel are the relevant OpenLayers API calls found at http://dev.openlayers.org/docs/files/OpenLayers-js.html<https://gcc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev.openlayers.org%2Fdocs%2Ffiles%2FOpenLayers-js.html&data=02%7C01%7Csteve.lime%40state.mn.us%7C2eec587306d04dfb3ffc08d70ae264ad%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636989839771390369&sdata=UWweeLR2vqMT3mghppc%2F08GUeYY97a11XN0MQu2lZd8%3D&reserved=0> (OpenLayers.Layer, OpenLayers.MapServer, & OpenLayers.Map). Everything that we’ve tried so far seems to simply reload the last cached image.



Another developer working with this has set up buttons that recenter the map to predetermined locations. This is what he has reported.

  *   Whenever we press one of these, we create a new OpenLayers.Map object (always with the same extents) and OpenLayers.Layer.MapServer (always with the same params). Then, we add the layer to the map object and call setCenter, with the lat-long and scale.
  *   If we center on Location A, then move a map marker (via a separate application) and go to Location B, the marker is seen in its new position. But if we click the button to recenter back on Location A, the marker appears to return to its old position. We suspect this is because the browser or the server is reusing a previously generated map image. If we reload the entire page, the marker is shown at its correct position.


Thank you for any insight/feedback you could provide.

Kind Regards.
Jerry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20190717/16bc860d/attachment.htm>


More information about the MapServer-users mailing list