[Mapserver-users] A Legend question and a Scale question
Richard Greenwood
rich@greenwoodmap.com
Fri, 13 Feb 2004 22:11:14 -0700
Richie Pierce wrote:
> 1) I have set a scale tolerance on some of my layers and I am
> trying to get the scale to print to the map so that the user will know
> what scale they are at. I grabbed some code from the GMAP demo and have
> gotten it to work, somewhat. It works except on the initial load of the
> page. When the page loads it prints -1.00000. But when the user clicks
> refresh, or zoom, or anything and updates the page. The scale is
> printed correctly. I was wondering what I’m missing. I was also
> wanting to remove the decimal points and round the scale to a whole
> number.
To round, try something like this:
<script language="JavaScript">
document.write("Scale 1:" + Math.round([scale]/100)*100);
</script>
--
Richard Greenwood
www.greenwoodmap.com
_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users