[Mapserver-users] scalebar params.

Steve Lime steve.lime at dnr.state.mn.us
Mon Jan 26 18:33:20 EST 2004


In the dbox example I used the values for mapext to facilitate caching
of scalebars. The logic is that that when panning why bother generating
a new scalebar, one is valid wherever you move. So the javascript you
mention below does just that. It looks at the overall dimension of the
map relative to 0,0, and when panning the second two numbers don't
change. Computationally it's the same as sending the raw extent. Granted
generating a scalebar is trivial compared to a map, but every little bit
helps I guess. 

The technique works fine for me here. Are you getting javascript
errors? What version of MapServer? 

Steve

>>> "Jason M. Nielsen" <jnielsen at aero-graphics.com> 1/23/2004 3:08:49
PM >>>
Wondering if someone might give me a link to detailed information about
how to
create scalebar when calling mapserv directly. ie: The parameters and
their
effects.  Or perhaps give me a little lesson here in the list.

I have been playing with the dBox stuff and Im having problems getting
the
scalebar to generate differently or should I say correctly.

http://192.168.168.201/cgi-bin/mapserv?map=/var/www/html/mymstest/utc.map&mode=scalebar&mapext=0+0+20160+20160&mapsize=600+600


Thats one example of what is being sent.  The later two numbers in
mapext change
on each zoom but the numbers on the scalebar refuse to change.  Its
always:

0 ----  58 ---- 116mi

What exactly causes this scale to change or how is it calculated?

The above link was generated via:

 document.scalebar_miles.src = MapServer + "?map=" + ms.mapfile +
"&mode=scalebar&mapext=0+0+" + (ms.extent[2] - ms.extent[0]) + "+" +
(ms.extent[3] - ms.extent[1]) + "&mapsize=" + ms.width + "+" +
ms.height;


Thanks, Jason.

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/ 
_______________________________________________
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