I cannot thank you enough, Charlie. Thank you very much for the
On Nov 17, 2:21 pm, Charlie DeTar <
cha...@gmail.com> wrote:
> OpenStreetMaps, Google Maps, and several others use 900913 projection
> internally. This is why in OpenLayers one must set "projection" to
> 900913. The "displayProjection" field (as described in the OpenLayers
> docs[1]) is only used for displaying data back to users.
>
> olwidget assumes that incoming vector data will be projected using
> "displayProjection", and translates that internally to the projection in
> "projection" (probably 900913) for display on the map.
>
> You can translate coordinates gotten from the map back into
> displayProjection using the OpenLayers API [2]:
>
> point.transform(fromProj, toProj);
>
> As an example, you might have something like this:
>
> var point = map.getLonLatFromPixel(new OpenLayers.Pixel(10, 10));
> point.transform(map.projection, map.displayProjection);
>
> -charlie
>