[mapserver-users] How do they do that???

Rob Martinson cathode at nichebox.com
Thu Nov 22 03:49:21 EST 2001


It is also possible to do this with a bit of Javascript and without
frames. And yes, you can implement the zoom rects as well. 

If you're familiar with the various implementations of onMouseOver image
swapping, the idea is the same. Basically your map image is in a
standard image tag with a name. Something like:

<img src="/buildmap.php?zoom=1" name="mymap" onClick="doclick();">

Buildmap.php would return ONLY image data for the requested map and
parameters. The doClick function would retrieve the clicked mouse coords
and create a new string to set as the src of this image and would do so
as:

if(document.formname.tool.value == 'zoomin'){
	zoom = zoom * 2;
}else if (document.formname.tool.value == 'zoomout'){
	zoom = zoom / 2;
}

document[mymap].src = 'http://domain.com/buildmap.php?zoom='+zoom;

Of course you would also pass the x/y coords and change any other
information you needed. In order to do this, you must use client-side JS
to preserve the state of any variables (zoom, x/y, etc.) but it's
relatively easy and works well. If you're interested in doing this and
need some help, I can setup a small sample if you like.

Hope this helps.

Rob Martinson
Nichebox - http://www.nichebox.com
 

> -----Original Message-----
> From: owner-mapserver-users at lists.gis.umn.edu 
> [mailto:owner-mapserver-users at lists.gis.umn.edu] On Behalf Of 
> Paul Ramsey
> Sent: Wednesday, November 21, 2001 8:41 PM
> To: Hankley, Chip; mapserver-users at lists.gis.umn.edu
> Subject: Re: [mapserver-users] How do they do that???
> 
> 
> You could also do it w/ JavaScript and frames, but you would 
> not be able to do the purty zoom boxes. I think ArcIMS uses 
> the Javascript / Frames approach for their 'html only' client.
> 
> "Hankley, Chip" wrote:
> > 
> > I've seen a few MapServer apps where, after a navigation event, the 
> > entire page doesn't reload... only the map window.
> > 
> > for example:
> > http://maps.dnr.state.mn.us/landview/
> > http://144.92.235.164/orthofinder/
> > 
> > How do they do that? Is this using Java? One site uses 
> frames and the 
> > other doesn't...
> > 
> > TIA
> > 
> > Chip Hankley
> 
> -- 
>       __
>      /
>      | Paul Ramsey
>      | Refractions Research
>      | Email: pramsey at refractions.net
>      | Phone: (250) 885-0632
>      \_
> 




More information about the mapserver-users mailing list