[mapserver-users] Programmatically refresh the current view

Jerry Faust jerryfaust1 at gmail.com
Wed Jul 17 11:12:36 PDT 2019


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
(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/1535c233/attachment.htm>


More information about the MapServer-users mailing list