[mapserver-users] Pre-defined Zoom In/Zoom Out buttons...

Joe Bussell joe at otsys.com
Fri Sep 27 10:45:08 PDT 2002


www.TrafficDodger.com has just such a zoom bar.  I view it like fliing
at different altitudes.  The higher you go, the more area you see and
you see less detail.  I use a zoomLevel variable in my javascript.  Each
button triggers a call to zoomToLevel with its own arguments.  Regular
zoomIn and zoomOut increment and decrement this value.  I then determine
the extent based on some function of the zoomLevel and my full scale
range.

Cordially,

Joe Bussell
On Time Systems
www.TrafficDodger.com



On Fri, Sep 27, 2002 at 09:45:06AM -0500, Mike Smith wrote:
> Sorry to bother everyone with this, I know this has been addressed 
> before in the archives, but I can't seem to find it when I search them.
> 
> I'm trying to enable a Zoom In/Zoom Out bar along side my map (kinda 
> like Mapquest or Yahoo maps) where there are buttons that either zoom 
> the user in or out to pre-determined levels.  I've got Javascript code 
> that zooms in and out ok, but the logic is what's throwing me off.  I 
> want the bottom button to always be the same view, not zoom them out 15 
> times from whatever their present view is.... it should zoom them out 15 
> times from full extent.  I want "full extent" to be the base and each 
> button whether it's a zoom in or out button needs to always zoom them to 
> the same factor relative to full extent, not their current view...make 
> sense?  I know I've seen a Mapserver page before that had this little 
> zoom bar that I'm describing, but I can't remember where I saw it. 
> Anybody have a web page that does this?  Or example code that handles 
> the logic of pre-defined absolute zoom levels (as opposed to the 
> relative ones that the CGI variable "zoom" sets)?
> 
> Thanks
> 
> 

-- 





More information about the MapServer-users mailing list