How to render current map scale via mapscript?

David Niergarth dn at HDDESIGN.COM
Fri Nov 16 12:33:26 PST 2007


Thanks Oliver! For Python mapscript it's the attribute mapObject.scale. It is 
documented in the API docs but I had never noticed.

--David

Oliver Wesp wrote:
> scale is an attribute of mapObj. I don't know for phyton but for java 
> its simple: map.getScale()
> 
> On Nov 14, 2007 6:50 PM, David Niergarth < dn at hddesign.com 
> <mailto:dn at hddesign.com>> wrote:
> 
>     Using an html template, I can render the current map scale using
>     [scale]. How
>     can I do this from mapscript?
> 
>     I'm not using html templates. Instead, I start with a map file,
>     instantiate it
>     in Python mapscript, add various layers, then render the map and legend.
> 
>     I'm trying to tweak my map file (adjusting MAXSCALE, MINSCALE for
>     layers) but
>     it's tedious without knowing what mapserver thinks the current map
>     scale is. Is
>     there some simple way to calculate the current scale?
> 
>     Thanks for any suggestions,
> 
>     --David
> 
> 



More information about the MapServer-users mailing list