Docs

Advanced feature styling

Mapforge stores your maps in GeoJSON format. Below you can see the list of supported properties to style your map elements (called features in GeoJSON).
Most of the properties are supported to be changed in the UI. For changing the properties directly, you can use the Edit JSON button in the feature details modal.

Supported feature attributes:

Mapforge supports every attribute and value of the Mapbox Simplestyle Spec 1.1.0, and it extends the spec with the attributes below. Mapforge stores the attributes as they are, so an export gives back the same values. A color must start with #: Mapforge does not draw a color like 7e7e7e, which the spec allows.

When you import a file, Mapforge converts the style attributes of uMap, Leaflet, OsmAnd and Garmin into the attributes below. It also converts uMap backup files (.umap) with their layers.

A feature without style attributes looks different from other simplestyle renderers, because Mapforge uses its own default values. For example, a marker is green and not gray (#7e7e7e).

Mapforge supports these feature attributes:

All geometries:

Point geometry:

LineString geometry:

Polygon geometry:

Label fonts

label-font takes an array of font names. Names are looked up in two places:

  1. The glyph server of the base map. Every base map ships a fixed set of fonts, so the valid names differ per map: noto_sans_regular / noto_sans_bold and 16 other families on the VersaTiles based maps (full list), Noto Sans Regular and friends on the MapTiler and OpenFreeMap based maps.
  2. Web fonts and device fonts. The browser renders each label with a font name that is not on the glyph server. It uses any font that the browser can resolve by CSS name. That includes the fonts on the device of the viewer. It also includes the web fonts that Mapforge loads on every page: SUSE, Bree Serif and Lobster Two.

Weight and style

For the default font of the base map, label-font-weight switches between regular and bold. For a label-font, the first entry of the array decides weight and style, the entries after it are the family the browser actually resolves:

{ "label": "Hello", "label-font": ["SUSE Bold", "SUSE"] }

Recognized keywords in that first entry: thin 100, extra light 200, light 300, regular 400, medium 500, semibold 600, bold 700, extra bold 800, heavy 900, plus italic and oblique. "SUSE Light Italic", "SUSE" renders SUSE at weight 300, italic.