Mapunits in template

Berend Veldkamp berend.veldkamp at ARIS.NL
Thu Sep 8 03:23:47 EDT 2005


listuser HH wrote:
> Berend Veldkamp wrote:
> 
>> Hi,
>>
>> I'm using mapserver as plain CGI and was wondering if there's a way to 
>> use the "units" parameter of a map in the template file? I need this 
>> to perform client side distance measurements.
>>
>> Thanks, Berend
>>
> Hi,
> 
> I don't know if and how you can do that with a template. But what I 
> would do is to use JavaScript. You should be able to make a small script 
> where you calculate the measurement form the extent in map coordinates 
> in reagard to the display coordinates. This only a quick thought but I 
> think it should work.
> 
> Best Regards,
> Norbert
> 


Norbert,

I think I didn't make myself clear enough... I already have a 
(JavaScript) function to measure distance in meters, feet, degrees, etc.

The problem is that I don't know in advance which units I should use. At 
this moment I've hard-coded the correct units in my template file, but 
I'd like the application to be general, so if I change the mapfile, or 
the data, I shouldn't have to change anything else.

Berend



-- 
____________________________

Berend Veldkamp - ARIS
http://www.aris.nl/
____________________________



More information about the mapserver-users mailing list