<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Berend,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Which version of chameleon are you using? I'm using
my own scaletool with a javascript calculation based on the current mapextents,
and the printsize. It then zooms to the newly calculated map-extents.
For latlong, I take into consideration the longitude. I use the
same calculation in CWC 1.0.4 as I do in chameleon 1.99, but only in
version 1.99 I managed to get to the same scale as the user enters. E.g. in CWC
1.0.4, my calculated extent resulted in a scale slightly different from what was
'predicted' (1:100005, in stead of 1:100000). I thought this was due to a
ronding error).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But in chameleon 1.99, I always get the right
scale, even if it is recalculating from 1:500 to 1:5000000. I use the same
calculation, but for some reason the mapextents can be set more precisely in
1.99. Whatever has changed in chameleon 1.99 worked well for me, but did not
find its way into the normal scale widget.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Paul, where can I see the calculation for the scale
widget? Do I need to check the mapserver source code for this?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>-----Original Message-----<BR>From: <A
href="mailto:chameleon-bounces@lists.maptools.org">chameleon-bounces@lists.maptools.org</A>
[mailto:chameleon-bounces@lists.maptools.org] On Behalf Of Berend
Veldkamp<BR>Sent: 23 September 2004 15:52<BR>To: Chameleon Users<BR>Subject: Re:
[Chameleon] Problem with Scale widget</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>Paul,</DIV>
<DIV> </DIV>
<DIV>Apparently it depends on the values I use for the width and height of
<BR>the MapWidget: with 780x537 the scale widget displays a value other than
<BR>I typed, a change of one pixel in either width or height solves it.</DIV>
<DIV> </DIV>
<DIV>BTW I'm not really concerned about the actual scale on screen, as long
<BR>as the value I type in the scale editbox remains the same and scale
<BR>dependent layers become visible at the right scale.</DIV>
<DIV> </DIV>
<DIV>Berend</DIV>
<DIV> </DIV>
<DIV><BR>Paul Spencer wrote:<BR>> Berend,<BR>> <BR>> I'm not sure that
the scale widget can zoom to an exact scale. The <BR>> scale is the
relationship between units on the screen and units on the <BR>> ground.
The scale calculations in mapserver take into account several <BR>> factors,
and the end result is an approximation of ground scale based on <BR>> several
assumptions concerning the dpi of the display and the distance <BR>> of 1
degree at a given latitude (to name a couple). So when zooming to <BR>>
a particular scale, this calculation is, in effect, reversed to <BR>>
determine how many ground units will fit inside a pixel and then the <BR>>
extents are set to match some approximation of this.<BR>> <BR>> That being
said, I don't think the discrepancy should be as big as you <BR>> are
indicating here so perhaps there is a problem. Please file a bug <BR>>
about this and I will try to take a look at it.<BR>> <BR>> Cheers,<BR>>
<BR>> PAul<BR>> </DIV>
<DIV> </DIV>
<DIV><BR>-- <BR>____________________________</DIV>
<DIV> </DIV>
<DIV>Berend Veldkamp - ARIS<BR><A
href="http://www.aris.nl/">http://www.aris.nl/</A><BR>____________________________<BR>_______________________________________________<BR>Chameleon
mailing list<BR><A
href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org</A><BR><A
href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</A><BR></FONT></DIV></BODY></HTML>