[OpenLayers-Users] Can I constrain a map to a certain scale in pixels/km?

Christopher Schmidt crschmidt at metacarta.com
Wed Jan 24 18:47:45 EST 2007


On Wed, Jan 24, 2007 at 11:19:25PM +0000, Nick Whitelegg wrote:
> 
> I'm developing a "slippy map" based on OpenStreetMap with SRTM contours. I 
> have pre-generated a set of 500x500 tiles of scale 100 pixels/km using 
> Mapnik. My maps are in OSGB projection: the bounding box requests are in 
> metre units.
> 
> With OpenLayers am I able to constrain the map to a certain number of 
> pixels/km e.g. either 100 or 200 (they are the scales I intend to support)?

Sure. Turn that into map units per pixel (100/1000 -> .1, iiuc), and
then send a 'resolutions' param in the map options. More info at
http://trac.openlayers.org/wiki/SettingZoomLevels 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list