Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
fonts complete Unicode circle
icons
imposm
labels_cities
labels_countries_states
renders
shp
FontSet_example.xml
Makefile
README.md
datasources-dymo.ini
datasources-ne.ini
datasources.ini
default_color_and_font_styles.mss
index.html
labels.mss
mapnik-render.py
naturalearth-lowzooms.mss
style-toner-standard.mml
style-toner-standard.xml
stylesheet.mss
toner-hybrid-only-labels.mml
toner-hybrid-only-labels.xml
toner-hybrid-only-lines.mml
toner-hybrid-only-lines.xml
toner-hybrid-with-labels.mml
toner-hybrid-with-labels.xml
toner-no-labels.mml
toner-no-labels.xml
transparent.png
views.pgsql

README.md

This is the place where are the non-database-y things required to generate the "Toner" Mapnik stylesheets are kept.

The style.mml and related .mss files control the look and feel of the Toner cartography. These files are writen in a preprocessor language called Cascadenik. If you make changes to the stylesheets, you will need to convert this to the native XML format that Mapnik supports to render the map tiles. Use the following command:

make style.xml

Which is really just a shortcut for typing this:

cascadenik-compile.py style.mml > style.xml

This will take your 'style.mml' and all the '.mss' files (the instructions that define the look and feel of the Toner maps) and smush them together to create a new file called 'style.xml'. This new file is what Mapnik uses to render maps.

There are also other Make commands for testing changes to the stylesheet by generating images of cities all over the world at different zoom levels. To test your Toner stylesheet for low (zoomed out) levels you would type:

$> make low-zoom-world.html
cascadenik-compile.py style.mml > style.xml
python mapnik-render.py -f fonts -s style.xml -l 0 0 -z 1 -d 1024 600 -o low-zoom-world-1.png
python mapnik-render.py -f fonts -s style.xml -l 0 0 -z 2 -d 1024 600 -o low-zoom-world-2.png
python mapnik-render.py -f fonts -s style.xml -l 38 -90 -z 3 -d 1024 600 -o low-zoom-world-usa-3.png
...and so on...

(If you're not sure what the "Make" program is, don't worry. It is a very old tool that was written to automate a series of discrete tasks and give them labels so that they can be invoked (repeated) with a minimum of fuss.

Toner comes in 3 flavors!

Option 1:

Normally we want to show the labels with the basemap.

The MML file would then read:

<Stylesheet src="naturalearth-lowzooms.mss"/>
<Stylesheet src="stylesheet.mss"/> 
<Stylesheet src="labels.mss"/>
<!-- 
      <Stylesheet src="labels_only.mss"/>  
-->

Option 2:

For map-only (no label) render

The MML file would then read:

<Stylesheet src="naturalearth-lowzooms.mss"/>
<Stylesheet src="stylesheet.mss"/> 
<!-- 
      <Stylesheet src="labels.mss"/>
      <Stylesheet src="labels_only.mss"/>  
-->

Option 3:

For labels-only render, we want the map background to be transparent, not black.

The MML file would then read:

<!--  <Stylesheet src="naturalearth-lowzooms.mss"/>
      <Stylesheet src="stylesheet.mss"/> 
-->
<Stylesheet src="labels.mss"/>
<Stylesheet src="labels_only.mss"/>
Something went wrong with that request. Please try again.