OpenLayers: Get resolution of map in a given projection (4326)

Posted by David Pfeffer on Stack Overflow See other posts from Stack Overflow or by David Pfeffer
Published on 2010-03-09T05:18:08Z Indexed on 2010/03/09 6:21 UTC
Read the original article Hit count: 247

Filed under:
|
|

I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...)

I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers.

What I'd like to do now instead is to only send data befitting the resolution of the current zoom. This should be relatively easy to do using the getResolution and calculateBounds methods on the Map object. calculateBounds returns a Bounds object that then can be transformed between the map projection and display projection.

How do I transform the resolution into my desired projection (4326 in this case)?

© Stack Overflow or respective owner

Related posts about openlayers

Related posts about JavaScript