[OpenLayers-Users] Resolutions problems

Christopher Schmidt crschmidt at metacarta.com
Thu Jul 26 07:37:28 EDT 2007


On Thu, Jul 26, 2007 at 11:40:30AM +0100, Tyler Durden wrote:
> Hi,
> I'm using Openlayers with Mapnik and Tilecache and I can't resolve the
> resolutions problem for the bounding box:
> bbox=-12.62878,36.27686,-2.79602,43.07739
> 
> The maps doesn't appear correctly and my GeoRSS points is out of place.
> 
> Tilecache configuration:
> ===================
> 
> [all]
> type=MapnikLayer
> mapfile=osm.xml
> bbox=-12.62878,36.27686,-2.79602,43.07739
> maxResolution=0.021972656
> resolutions=0.021972656,0.010986328,0.005493164
> levels=10
> extension=png
> srs=EPSG:4326
> debug=on
> 
> Openlayers:
> ==========
> 
> var bounds = new OpenLayers.Bounds(-12.62878, 36.27686, -2.79602, 43.07739);
>  var options = {maxResolution: 0.060253125,
>                     numZoomLevels : 10,
>                     projection    : "EPSG:4326",
>                     controls : controls };
> 
> map = new OpenLayers.Map('map', options);
> layer_all = new OpenLayers.Layer.TMS("all",
> "http://192.168.1.160:8080/", layername: 'all', type:'png'} );
> map.addLayer(layer_all);
> 
> How can I adjust the resolutions?

I'm not sure what you mean. Your maxresolution in openlayers and
TileCache don't match. You should make them match. (And then clear your
cache.) Additionally, I would recommend using: 
  
  new OpenLayers.Layer.WMS("all", "http://192.168.1.160:8080/",
  {'layers':'all'}) 

instead of what you're currently using, because TMS is not as well
tested as WMS. TMS doesn't care if your tiles are off. WMS does, and
would have told you so.   

> What is the diference between maxResolution and resolutions?

resolutions is a list of resolutions. maxResolution is a top level,
which is then divided by 2 many times to get a list.   

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list