[Tilecache] Setting Up tilecache to use mapnik
ritesh ambastha
ritesh.linux at gmail.com
Sat Jul 25 16:32:47 EDT 2009
Few pointers for you:
Add 'bbox' parameter in your tilecache.cfg file. Also, try changing
'type=Mapnik' to 'type=MapnikLayer'.
Also, please post us the error message you are getting.
Regards,
Ritesh Ambastha
Jeffrey04 wrote:
>
> Hi,
>
> I am trying to setup a tilecache installation that uses mapnik generated
> tiles. However, the basic layer that comes with the default installation
> works but not my mapnik layer. All I get from my mapnik layer is a set of
> tiles in steelblue background color (as defined in the xml file)
>
> this is what I have in my tilecache.cfg
>
> [cache]
> type=Disk
> base=/tmp/tilecache
>
> [basic]
> type=WMS
> url=http://labs.metacarta.com/wms/vmap0
> extension=png
>
> [mapnik]
> type=Mapnik
> mapfile=/home/jeffrey04/Projects/mapnik/world_styles.xml
> metaTile=yes
> #spherical_mercator=true
> tms_type=google
> srs=EPSG:900913
> levels=18
> metaBuffer=40
>
> this is my xml file for mapnik (taken from mapnik tutorial, and uses the
> mapnik provided world borders)
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE Map>
> <Map bgcolor="steelblue" srs="+proj=latlong +datum=WGS84">
>
> <Style name="my">
> <Rule>
> <PolygonSymbolizer>
> <CssParameter name="fill">#f2eff9</CssParameter>
> </PolygonSymbolizer>
> <LineSymbolizer>
> <CssParameter
> name="stroke">rgb(50%,50%,50%)</CssParameter>
> <CssParameter name="stroke-width">0.1</CssParameter>
> </LineSymbolizer>
> </Rule>
> </Style>
>
> <Layer name="world" srs="+proj=latlong +datum=WGS84">
> <StyleName>my</StyleName>
> <Datasource>
> <Parameter name="type">shape</Parameter>
> <Parameter
> name="file">/home/jeffrey04/Projects/mapnik/world_borders/world_borders</Parameter>
> </Datasource>
> </Layer>
>
> </Map>
>
> the open layers code
>
> <!--
> var map, layer;
>
> function init(){
> map = new OpenLayers.Map( $('map'), {'maxResolution':
> 360/512});
> map.addLayer(
> new OpenLayers.Layer.WMS( "mapnik",
> "tilecache.cgi?", {layers: 'mapnik', format:
> 'image/png' } )
> );
> layer = new OpenLayers.Layer.WMS( "basic",
> "tilecache.cgi?", {layers: 'basic', format:
> 'image/png' } );
> map.addLayer(layer);
> map.addControl(new OpenLayers.Control.LayerSwitcher())
> map.addControl(new OpenLayers.Control.Permalink());
> if (!map.getCenter()) map.zoomToMaxExtent();
> }
> // -->
>
> The xml file is tested working by passing it to nik2img.py script that
> generates .png file from xml.
>
> Is there any detailed documentation on how to setup tilecache to work with
> mapnik? Besides that, how can I diagnose a problem? is there a log or
> something?
>
> Regards,
> Jeffrey04
>
--
View this message in context: http://n2.nabble.com/Setting-Up-tilecache-to-use-mapnik-tp3173112p3326729.html
Sent from the TileCache mailing list archive at Nabble.com.
More information about the Tilecache
mailing list