[OpenLayers-Dev] Design for scale-line

Paul Spencer pspencer at dmsolutions.ca
Mon Oct 8 16:53:05 EDT 2007


On 8-Oct-07, at 4:01 PM, Ian Mayo wrote:

> thanks again for the feedback, comments below...

:) looking forward to having this in trunk ...

>
>> 3) If the units are decimal degrees, you should adjust the
>> calculation based on the current latitude of the center using the
>> cosine of the latitude.  This was from a distance measuring tool I
>> did a while back:
>> d = d * Math.cos(2 * Math.PI * map.center.lat / 360);
>
> Ooh Paul, you couldn't just point me to where/how I need to switch my
> algorithm to accommodate this?  Is it right at the start when I
> convert the maxSizePx in pixels to data units?

I didn't spend any time looking at where to put this :(  If you are  
having trouble, I can take another look ...

Cheers

Paul

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+



More information about the Dev mailing list