[mapserver-users] Re: [mapserver-dev] zoom box in JavaScript (not Java)

Gary Nicholson gary at imapping.co.nz
Sat Sep 28 14:52:09 PDT 2002


Hi,

I've developed my own DHTML map viewer which although not directly 
compatable with mapserver can be used with the WMS connector.  It includes 
zoom boxes so feel free to look at the javascript code to see what I've done.

They also are in framesets with the drawing origin at 0,0.  It is a lot easier to 
make it work  across browers like that.  It can be tricky to find the origin of the 
map if it isn't hardcoded but not impossible.

See my viewer in action at:

http://www.wherearewe.co.nz/newzealand.html

Cheers

Gary Nicholson
 

On Sunday, September 29, 2002, at 05:18  AM, Alex Rice wrote:

[reposting on mapserver-users, -dev is for mapserver internals discussion -- 
alex]

On Friday, September 27, 2002, at 12:39  PM, Brent Fraser wrote:

Hey,
 
  Does anyone know how http://kei.kodak.com/HTMLMap.asp can use 
JavaScript to do a zoom box?I thought JavaScript was too limited draw lines on 
an image and we were stuck using Java.
 
I'm jealous.

Nope, javascript can be used. However it's heavy on the CSS and DHTML stuff-- 
you might run into browser compatibility issues. No more so than trying to run a 
Java applet though.

I've been playing around with some free Javascript I found at esri.com. But  haven't b
een able to make it do exactly what I want it to do. It seems to want to be in a 
frameset with all drawing starting at 0,0. It would be great if mapserver came 
with some HTML templates and javascript helper functions like this!

Here is the readme

""ZoomBox

What is it?
This is a sample of the ZoomBox used in the ArcIMS HTML Viewer.
This sample contains the functions used to create and manipulate
the "rubberband" box on the map display. Some of these functions
have been stripped of any additional routines or variables not
needed for demonstrating the ZoomBox capabilities.

How to start it:
Load ZoomBox.htm in a browser (version
 4 or newer). Press down on
the left mouse button a
n
d drag (move the 
mouse with the button
pressed). The ZoomBox should appear and the 
box coordinates will
display in the Status Bar. Let up on the b
utton and the ZoomBox
will disappear.""

See HTML ZoomBox Demo  @

http://support.esri.com/products/downloads/default.asp?p=6



A
lex Rice, Software
 
Developer
Architectural R
esearch Consultants, Inc.
alrice at swcp.com
alex_rice at arc.to



gary at imapping.co.nz
www.imapping.co.nz
creaters of www.wherearewe.co.nz




More information about the MapServer-users mailing list