[OpenLayers-Users] Extent with Spherical Mercator

Albin Blaschka albin.blaschka at standortsanalyse.net
Sun May 3 11:13:16 EDT 2009


Eric Lemoine schrieb:
> On Sunday, May 3, 2009, Albin Blaschka
> <albin.blaschka at standortsanalyse.net> wrote:
[snip]
>>
>>      var bounds = new OpenLayers.Bounds(12.5, 47.0, 13.5, 48.0);
>>      bounds.transform(proj, map.getProjectionObject());
>>
>>      var point = new OpenLayers.LonLat(13.0, 47.41);
>>      point.transform(proj, map.getProjectionObject());
>>      map.setCenter(point);
>> }

> Either use map.zoomToExtent(bounds) or map.setCenter(lonlat,
> zoomLevel) (you don't give setCenter a zoom level in the code you
> provided above)
> 

Hello,

Thank you very much - map.zoomToExtent(bounds) did it (did not try the 
other possibility)

Those little, but important details... :-P

best wishes,
Albin


--
---------------------------------------------------------------------
| Albin Blaschka, Mag. rer.nat - Salzburg, Austria
| http://www.albinblaschka.info   http://www.thinkanimal.info
| It's hard to live in the mountains, hard, but not hopeless!
---------------------------------------------------------------------



More information about the Users mailing list