Hey-

Zac Barton wrote:
> Hey Darko
> 
> You can use your_map_object.getExtent() to get what you're after.
> 
> Regards
> 
> Zac
> 
> 2008/7/4 Darko Radiceski <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
> 
>     Dear all,
>      
>     Is it possible to work out the lons and lats of all 4 corners of a
>     map at a particular zoom level?
>      

Also, if you want to know the extent for a zoom level different than the 
current zoom level, resolution is your friend.

Resolution is the number of map units per pixel.  So, first find the 
resolution given the zoom.

var res = map.getResolutionForZoom(zoom);
var upperLeft = new OpenLayers.LonLat(
     map.center.lon + (res * map.size.w / 2),
     map.center.lat + (res * map.size.h / 2)
);

Other corners are up to you.

Tim

>     Cheers
>     Dan
> 
>     -- 
>     Radiceski Dan
>     University of Wollongong
>     Australia
>     SIFE - UOW Chapter - Alumni
>     CASUAL ACADEMIC STAFF TEACHING - UOW SITACS
>     (School of Information Technology and Computer Science,University of
>     Wollongong)
>     Univeristy of Wollongong - Alumni
> 
>     _______________________________________________
>     Dev mailing list
>     [email protected] <mailto:[email protected]>
>     http://openlayers.org/mailman/listinfo/dev
> 
> 
> !DSPAM:4033,486dcdfc276108992556831!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Dev mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/dev
> 
> 
> !DSPAM:4033,486dcdfc276108992556831!

_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to