[OpenLayers-Users] Re projecting Google

Christopher Schmidt crschmidt at metacarta.com
Tue Jan 22 07:29:56 EST 2008


On Tue, Jan 22, 2008 at 04:26:46AM -0800, Jon Britton wrote:
> 
> Aha! Thanks. When you say "everything is translated for you" does that
> include ouputs from Bounds objects?
> 
> I've got a custom control that allow the user to select an area of interest
> (which will be used for something else later). Will the bounding box for
> this selection be translated?

Sorry, no: only the controls have this logic. (Since the getExtent
function is used *internally*, it needs to use the projection of the
map: I'm considering adding an option to let you control what it
returns, but that's probably for 2.7.)

However, any object returned from getBounds, getLonLat, etc. can be
translated with:

  object.transform(map.getProjectionObject(), map.displayProjection);

It will be transformed in place, and you can then use the bounds for
further manipulation.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list