[OpenLayers-Users] Documentation of apparent functionality duplication?

Eric Lemoine eric.lemoine at camptocamp.com
Mon May 10 15:33:20 EDT 2010


On Tuesday, May 4, 2010, Mike Purvis <mike at uwmike.com> wrote:
> Hi again,
> I'm confused at a number of points where OpenLayers seems to contain multiple possible ways of doing the same thing. For example, what is a Geometry.Point?

A geometry represents a shape that can be drawn in a vector layer.

> Is it closer in spirit to a LonLat or a Pixel?

A lonlat, as a lonlat and a point both represent a geographic
location. A lonlat isn't a shape and cannot be drawn.

A pixel represents a position in the map div, its x and y values are
expressed in pixels.

A Map object exposes method for converting a pixel to a lonlat and vice-versa.

>Why does its constructor take x and y rather than a LonLat or Pixel?

OpenLayers could indeed include a Geometry.Point.fromLonlat conveniene
function or something, but it currently doesn't have such a function.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list