[Mapserver-users] Zoom previous

Martin, Daniel A Daniel.A.Martin at erac.com
Wed Nov 26 11:08:03 EST 2003


Of course, you are assuming Stéphane is using a scripting language, and not the standard CGI MapServer.

Using the history has definite problems.  Perhaps the new page loaded a new layer or other dynamic change to the content.  Another problem with using history is that changes to a form stay with the history.  If you use an HTML legend that displays checkboxes for indicating which layers or on and for turning on and off layers (as many apps do) loading history after turning on some layers displays an incorrect legend.

You could try to work around these issues, but I think you could accomplish this through better means.  You could pass previous extents in your form.  Something like this (code is untested):

<form name=myMapForm>
...
<input type=button value="Previous Zoom"
	onclick="document.myMapForm.imgext='[lastextent]';document.myMapForm.submit()">

<input type=button value="Submit" 
	onclick="document.myMapForm.lastextent='[imgext]';document.myMapForm.submit()">
</form>

The first button sets the new extent to the previous extent, whereas the second button submits as normal, but saves the current extent as the last extent for the next map.

-Dan


> -----Original Message-----
> From: mapserver-users-admin at lists.gis.umn.edu 
> [mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of 
> Lawrence, Kevin
> Sent: Wednesday, November 26, 2003 9:04 AM
> To: stephane.riff at cerene.fr; 
> mapserver-users at lists.gis.umn.edu; 'Chip Hankley'
> Subject: RE: [Mapserver-users] Zoom previous
> 
> 
> if you are using sessions store the previous coordinates in a 
> session variable and when previous is requested simply re-use 
> those extents.
> 
> > ----------
> > From: 	Chip Hankley[SMTP:Chip.Hankley at rmtinc.com]
> > Sent: 	Wednesday, November 26, 2003 9:39 AM
> > To: 	stephane.riff at cerene.fr; 
> mapserver-users at lists.gis.umn.edu
> > Subject: 	Re: [Mapserver-users] Zoom previous
> > 
> > >Does anyone already did a zoom previous function...
> > 
> > A low-tech way to do this that works a LOT of times is to 
> simply use 
> > the 'back' function inherent in the web-browser. You can 
> simply apply 
> > the javascript 'history.back()' to a button, and call it "zoom to 
> > previous extent" or something. This is the equivalent of 
> hitting the 
> > 'back' button.
> > 
> > Chip Hankley
> > 
> > Outgoing messages, along with any attachments, are scanned 
> for viruses 
> > at RMT prior to sending.
> > 
> ----------------------------------------------------------------------
> > ----
> > ----
> > NOTICE--This email may contain confidential and privileged 
> information 
> > for the sole use of the intended recipient.  Any review or 
> distribution
> > by others is strictly prohibited.  If you are not the 
> intended recipient,
> > please contact the sender immediately and delete all copies.
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu
> > http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> > 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/maps> erver-users
> 




More information about the mapserver-users mailing list