[OpenLayers-Users] OpenLayers / TileCache setup

Daniel Behr daniel.behr at hzg.de
Mon Oct 31 04:11:27 EDT 2011


Hi John,
please stay on the mailing list...

Did you check the these docs?
http://tilecache.org/docs/README.html
http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels

Its been a while since I looked at my config, but I guess resolution is 
your problem. I remember that I also had a play with the values a bit to 
get it working. I'm using 20 zoomLevels, so have you tried with 
maxResolution= 78271.517 when using 19 levels? or maybe set an array of 
resolutions?

and what does http://<yourserver>/tilecache/1.0.1/osm return?

HTH
Daniel


Am 28.10.2011 20:22, schrieb John Williams:
> Thanks, Daniel. Even when I set the bbox and maxResolution in both
> tilecache.cfg and my OpenLayers javascript, the tiles don't line up.
> They're no even off by just a little... it looks like a mish-mash of
> tiles all over the place.
>
> [osm]
> type=Mapnik
> mapfile=/home/jd/mapnik/osm.xml
> spherical_mercator=true
> bbox=-20037508.34,-20037508.34,20037508.34,20037508.34
> maxResolution=156543.03390625
> levels=19
> units=m
> srs=EPSG:900913
> extent_type=loose
>
>
>       options = {
>            maxResolution: 156543.03390625,
>            units: 'm',
>            projection: new OpenLayers.Projection("EPSG:900913"),
>            displayProjection: new OpenLayers.Projection("EPSG:4326"),
>            maxExtent: new
> OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
>            restrictedExtent: new
> OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
>            numZoomLevels: 19
>      };
>
>      map = new OpenLayers.Map('map', options);
>
>      layer = new OpenLayers.Layer.TMS("osm", "/tilecache/", {
>          serviceVersion: "1.0.1",
>          layername: "osm",
>          type: "png",
>          sphericalMercator: true
>      });
>
> Best I can tell, everything is matched up between the two, which is what
> everyone says to do, but it still doesn't work. I manually generated the
> tiles with mapnik and then again with tilecache_seed. The tiles looked
> fine via manual inspection. It's just when OpenLayers requests them that
> they don't look right. Any other thoughts?  Thanks...
>
> On Fri, Oct 28, 2011 at 1:20 AM, Daniel Behr <daniel.behr at hzg.de
> <mailto:daniel.behr at hzg.de>> wrote:
>
>     Hi,
>     my settings for tilecache look like this:
>
>     [osm]
>     type=MapnikLayer
>     mapfile=/osm_map.xml
>     bbox=-20037508.34,-20037508.__34,20037508.34,20037508.34
>     maxResolution=156543.03390625
>     levels=20
>     spherical_mercator=true
>     metaTile=yes
>     metaBuffer=128
>     srs=EPSG:900913
>     extent_type=loose
>
>     HTH
>     Daniel
>
>
>     Am 27.10.2011 22:31, schrieb John Williams:
>
>         I have a setup with mapnik, tilecache and OpenLayers on Ubuntu
>         that I
>         can't get to work quite right. I'm mailing this list because I'm
>         pretty
>         sure it's an issue with my OpenLayers configuration. My
>         tilecache config
>         looks like this:
>
>         [cache]
>         type=Disk
>         base=/tmp/tilecache
>
>         [osm]
>         type=Mapnik
>         mapfile=/path/to/osm.xml
>         spherical_mercator=true
>         levels=19
>
>         And my javascript:
>
>         options = {
>                    maxResolution:156543.0339,
>                    units:'m',
>                    projection: new OpenLayers.Projection("EPSG:__900913"),
>                    displayProjection: new
>         OpenLayers.Projection("EPSG:__4326"),
>                    maxExtent: new
>         OpenLayers.Bounds(-20037508.__34,-20037508.34,20037508.34,__20037508.34),
>                    restrictedExtent: new
>         OpenLayers.Bounds(-20037508.__34,-20037508.34,20037508.34,__20037508.34),
>                    numZoomLevels: 19
>         };
>
>         map = new OpenLayers.Map('map', options);
>
>         layer = new OpenLayers.Layer.TMS("osm", "/tilecache/",
>                      {serviceVersion: "1.0.1", layername: "osm", type:
>         "png",
>         sphericalMercator: true});
>
>         map.addLayer(layer);
>
>         I'd appreciate any thoughts about what I am/may be doing wrong.
>         Thanks!
>
>
>         _________________________________________________
>         Users mailing list
>         Users at lists.osgeo.org <mailto:Users at lists.osgeo.org>
>         http://lists.osgeo.org/__mailman/listinfo/openlayers-__users
>         <http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
>     Helmholtz-Zentrum Geesthacht Zentrum für Material- und
>     Küstenforschung GmbH Max-Planck-Straße 1 I 21502 Geesthacht I
>     Deutschland/Germany
>     Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser,
>     Dipl.-Ing. Michael Ganß Vorsitzender des Aufsichtsrates/Chairman of
>     the Supervisory Board: MinDirig, Wilfried Kraus Amtsgericht Lübeck
>     HRB 285 GE (Register Court) Internet: http://www.hzg.de
>       _________________________________________________
>     Users mailing list
>     Users at lists.osgeo.org <mailto:Users at lists.osgeo.org>
>     http://lists.osgeo.org/__mailman/listinfo/openlayers-__users
>     <http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
>
Helmholtz-Zentrum Geesthacht 
Zentrum für Material- und Küstenforschung GmbH 
Max-Planck-Straße 1 I 21502 Geesthacht I Deutschland/Germany 

Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Ganß 
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: MinDirig, Wilfried Kraus 
Amtsgericht Lübeck HRB 285 GE (Register Court) 
Internet: http://www.hzg.de  


More information about the Users mailing list