[OpenLayers-Users] projections/resolution/extents

Christopher Schmidt crschmidt at metacarta.com
Thu Aug 7 08:24:28 EDT 2008


On Thu, Aug 07, 2008 at 05:12:10AM -0700, FCampos wrote:
> 
> Hi,
> is there anywhere, a good tutorial for :
> 
> - what extents in mapserver, and what is the consequence in the resolution /
> extent/ scales of openlayers ? 

Resolution is "map units per pixel". By default, OpenLayers uses a
maxExtent of: 

  -180,-90,180,90

It uses a default maxResolution of:

  1.40625

Which means that each tile is:

  1.40625 * 256 -> 360 map units (degrees)

Scales are never important to OpenLayers, but you can display them
(using OpenLayers default DOTS_PER_INCH of 72) using the
OpenLayers.Control.Scale(), which allows you to use those values in
other tools like SLD or Mapfiles.

To pick a good maxResolution, generally taking your map extent and
dividing by 256 or 512 is a good start. You can also set maxResolution
"auto" -- this will divide the extent by the size of your map in the
larger direction, fitting your map tiles exactly (at the cost of using
different URLs for different map sizes, and therefore avoiding caches
and not working with things like TileCache).  

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list