Map Layering



This section gives a quick introduction in how Maperitive layers map elements when drawing a map. The layering affects what elements will be drawn visible above and what elements will be hidden or partially hidden by other elements.

As the writer of rules you can influence this to a great extent. But there are also some built-in mechanisms in Maperitive which help you avoid problems like having a village name label partially hidden by a forest polygon.

Symbols And Layering

Each of Maperitive map symbols has an intrinsic drawing priority. There is no point in displaying a text label which is then covered by some grassy field - text labels are for humans and if they are not visible, they have no function, since no one can read them. That's why all text symbols in Maperitive are drawn above anything else. The next symbol in priority is an icon (so texts can overlap icons, but not vice versa). After the icons, we have lines and contours. Below these come fill symbols. So poor old fill symbols are constantly pushed around (or below, to be precise) by their older brothers.

NOTE: There are some other special symbol types, like the map background and sea, which are drawn below everything else.

Have Your Say

So I have just described the ground rules which you cannot change. Where it gets interesting is when the two symbols of the same type meet. This is the part you can change.

NOTE: I use the phrase "in general" because you have to take into account other mentioned factors when figuring out the layering.

OSM Layers

For features that come from the OSM world, another thing that influences the drawing priority is the layer tag. This tag takes precedence over the ordering of rules and features mentioned above. So a bridge with layer=1 will be drawn above a canal OSM way if the canal has a layer value of 0 or below (or it doesn't have a layer value specified at all).

There is a way to override this behavior by setting the TopmostLayer (TODO) rendering property to true. With this property turned on, all the rendered features will behave as if they have the highest possible layer tag value. This is especially useful when rendering relations, since usually a relation itself does not have a layer tag and Maperitive will use layer tag values of relation's members (which can vary). If you want to make sure all the relation's members are drawn on top of everything else, set the TopmostLayer (TODO) to true.

Examples And Tricks


See also: