[OpenLayers-Users] Getting jumbled tiles from tilecache server

Sanjiv Singh singhsanjivk at gmail.com
Wed Jul 23 15:15:40 EDT 2008


Hi all,

I have setup a tilecache server which serves OpenStreetMap Data using
Mapnik. I am using the following code to read from the tilecache
server:

function init(){
    map = new OpenLayers.Map('map', {
                      projection: new OpenLayers.Projection("EPSG:900913"),
                      displayProjection: new OpenLayers.Projection("EPSG:4326")
                    });

    osm = new OpenLayers.Layer.TileCache( "OSM Layer",
                    ["http://localhost:8080/tiles"], "osm");

    map.addLayer(osm);
    map.setCenter(new OpenLayers.LonLat(0, 0).transform(new
OpenLayers.Projection("EPSG:4326"), new
OpenLayers.Projection("EPSG:900913")), 0);
}

I am able to get the map from the server. But as I keep zooming in, I
can see only jumbled tiles. I had used the spherical mercator option
when importing OSM data using osm2pgsql. My mapnik is working properly
as I am seeing the tiles generated by generate_tiles.py correctly in
openlayers using the OpenLayers.Layer.OSM.Mapnik layer.

What am I doing wrong ? Should I post this in tilecache ML too?

Regards
Sanjiv



More information about the Users mailing list