[OpenLayers-Users] which js files the methods getScale getLength getArea in?

Eric Lemoine eric.c2c at gmail.com
Thu Oct 11 02:14:26 EDT 2007


On 10/11/07, Yang Zhaohui <yangzhaozhao2008 at 163.com> wrote:
>
> Hello dear sir,
>     I am very appreciated with the OpenLayers 2.5.I am very like the new features added.
> I have a problem to consult you about the methods
>            map.getScale() ,
>            feature.geometry.getLength()
>            and feature.geometry.getArea().
>     Because the coordinates I used in the map is longitude/ latitude, and I donnot know
>  which units you carried,I wonder are they  calculated correctly.I want to know how the methods  programed,and what js file they are in?Thank you very much!
>                                                            Sincerely yours,
>                                                                  Yang

Hi Yang,

getLength() and getArea() won't return correct results if you map uses
degrees. And for the record, these two methods are defined in
lib/OpenLayers/Geometry.js, and they are overriden in
Geometry/Polygon.js and friends.

Hope this helps,

--
Eric



More information about the Users mailing list