[Mapserver-users] Re: jBox

Michael Smith msmith at sanangelompo.org
Fri Feb 27 17:03:50 EST 2004


 That got it!! Thanks again Rich!

-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Richard
Greenwood
Sent: Thursday, February 26, 2004 4:01 PM
To: Michael Smith
Cc: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Re: jBox

Michael Smith wrote:

> Rich,
> 
> You have helped me tremendously in the past so I thought I would ask 
> you a question.  I have jBox working but am unclear on how to get the 
> measure tool working.  I put this code:
> 
> 	function measure_handler(name, s, t, n, a) {
> 		// c = 1 / 72dpi / 12inches_per_foot * 
> 1.0003state_plane_scale_factor
> 		var c = 0.0011577546296296;	// constant
> 		var f = [scale] * c;		// scale factor
> 		if ((s>0) || (t>0)) {
> 			defaultStatus = "This segment = " + s*f + ", Total =
" + t*f + ", 
> Number of vertices = " + n ;
> 		}
> 	}
> 
> in the head of my html.  Do you have an example of what I do next.  I 
> am not very familiar with js, so any help is appreciated.  I do have a 
> measure icon on my html page, so how could I make a click of this 
> button work the measure tool.  Thank you in advance.
> 
> Michael Smith, Planner II
> City of San Angelo
> Planning & Development
> 325.657.4210 Fax: 325.481.2648
> Email: msmith at sanangelompo.org

Just call document.jBox.lineon(); when the user selects the measure button.
This will put jBox into "measuring" mode. As the user moves the mouse, jBox
will call the measure_handler() function, which converts the screen pixel
coordinates to feet, and displays the result in the browser's status bar.
Note that c is for my state plane coordinate zone and elevation, and will
need to be calculated for your needs.

(I am cc'ing the list so that this finds it's way to the archive)

--
Richard Greenwood
www.greenwoodmap.com
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list