[mapserver-users] How to keep map from zooming/panning when I refresh?

Puneet Kishor pkishor at GeoAnalytics.com
Thu Sep 5 13:22:12 EDT 2002


Mike,

Just add a 'redraw' button and on the server side check if the pan/zoom
button exists or not... if it doesn't, don't redo any mapextent
calculations.

pk/


> -----Original Message-----
> From: Mike Smith [mailto:nospam at cnrit.tamu.edu]
> Sent: Thursday, September 05, 2002 10:01 AM
> To: mapserver-users at lists.gis.umn.edu
> Subject: [mapserver-users] How to keep map from zooming/panning when I
> refresh?
> 
> 
> Hello,
> 
>     I've got my page working pretty well now thanks to lots of 
> Javascript code I borrowed from this mailing list, but I've still got 
> one problem that I can't seem to find a solution for in the archives. 
>  I've got my page set up so that the various layers that are 
> available 
> to view are in a list on the right-hand side of the page with 
> checkboxes 
> next to them.  And since I wanted the behavior of the page to imitate 
> ArcView as much as possible (because most of my users are 
> used to that 
> interface) I put in a little javascript function that automatically 
> reloads the page whenever they check or uncheck a layer 
> (without having 
> to click a "refresh" button).  My problem is that the layer loads or 
> unloads fine, but my image also pans or zooms at the same 
> time depending 
> on what function they have checked.  How can I make my page reload 
> without changing the current view at all?  Even if they have 
> the "Zoom 
> In" button clicked and the zoomsize is set to "2" I don't 
> want the page 
> to zoom in when they just add a new layer.  Is there a value 
> that I can 
> set "zoomdir" to besides 1, 0, or -1 that basically disables 
> panning and 
> zooming altogether?
> 
> Thanks in advance,
> 
> Mike Smith
> 
> P.S. - Here's my javascript code that automatically 
> loads/unloads layers:
> 
> function UpdateMap() {
>     document.mapserv.submit();   //Note that my form name is "mapserv"
> }
> 
> Then I add this to my checkbox tag:
> 
> onClick="UpdateMap();"
> 



More information about the mapserver-users mailing list