Rob,

Your setup looks on the right track, but is incomplete at the  
OpenLayers step.

If you are setting up a TileCache layer using 'type=Mapnik' in  
spherical mercator then that needs to be requested via OpenLayers with:

1) An OpenLayers map in the same projection and
2) using an OpenLayers.Layer.TMS/OSM layer.


For #1 try something like:

var options = {
     maxResolution: 156543.0339,
     units: 'm',
     projection: new OpenLayers.Projection("EPSG:900913"),
     maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,  
20037508.34, 20037508.34)
     };

map = new OpenLayers.Map("map", options);

and for # 2 do:

var tad_tms = new OpenLayers.Layer.TMS("TileCache Mapnik 
Layer","http://localhost/tilecache.py? 
",
                 { serviceVersion: "1.0.0", layername: "tad",  type:  
"png" });
map.addLayer(tad_tms);

I would keep it simple for your TileCache.cfg at first and pair that  
OpenLayers map request with a tilecache config like:
[tad]
type=Mapnik
mapfile=C:\data_dir\data\shapefiles\tad.xml
spherical_mercator=true
Dane
On Aug 1, 2009, at 5:12 AM, rob777 wrote:

>
> I hope someone can help.
>
> I have Mapnik up and all examples are working.
>
> I have Tilecache up and it's example is working.
>
> When trying to get the two to work it fails.
>
> Can some one please tell us or point us to documentation on the  
> proper way
> to use these two togeather.
>
> My tilecache.cfg looks like this.
> [tad]
> type=mapnik
> mapfile=C:\data_dir\data\shapefiles\tad.xml
> extension=png
> metaTile=yes
> spherical_mercator=true
> tms_type=google
>
> My OpenLayers Looks like this.
> <script type="text/javascript">
>        <!--
>        var map, layer;
>
>        function init(){
>            map = new OpenLayers.Map( $('map'), {'maxResolution':  
> 360/512});
>            layer = new OpenLayers.Layer.WMS( "mapnik",
>                    "tilecache.py?", {layers: 'tad', format: 'image/ 
> png' }
> );
>            map.addLayer(layer);
>            map.addControl(new OpenLayers.Control.Permalink());
>            if (!map.getCenter()) map.zoomToMaxExtent();
>        }
>        // -->
>    </script>
>
>
> Any help is appreciated.
>
> Thanks,
> Rob
> -- 
> View this message in context: 
> http://www.nabble.com/Mapnik-%2B-Tilecache-%2B-OpenLayers-tp24768564p24768564.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to