Skip to content
MangoMap Help Centre
Esc
↑↓navigate↵open⌘Jpreview
On this page

How to style features by category

Give every point, line, or polygon with the same value the same colour, from a text field or from numeric codes such as zone numbers or years.

Pick a field in the layer’s colour driver, and every point, line, or polygon with the same value gets the same colour and its own legend entry. A text field gives categories at once; a numeric field starts as classes, so set Style as to Categories.

See it on an example map

Open the World Atlas. In the legend, open the Thematic folder and turn on only Countries — Income Group. Turn off Countries — Population. Each income group has its own colour and legend entry.

See it on points

Open the Singapore Point Styling Lab. See Emergency — Icons by Type in the legend.

See a 0/1 field as categories

Open the World Point Styling Lab. See Major Cities — Megacities in the Icons folder of the legend.

Before you start

  • You need edit access to the map.
  • Choose the field. A text field works, such as a road class, a building type, or an income group. A numeric field that holds codes also works: zone numbers, years, ratings, or the number of lanes on a road. For a measured amount, such as population or rainfall, use How to style features by quantity instead.
  • On a point layer, set Marker type to Circle or Icon. Custom Icon and Heatmap markers have no field colour.
  • Pick the field before you customise anything. Changing the field rebuilds the categories from scratch.

The steps are the same for points, lines, and polygons. Some control names, and what each category can change, depend on the geometry:

Point Line Polygon
Colour driver Colour markers by Colour lines by Fill polygons by
No-field option Single colour Uniform colour Uniform colour
Palette dropdown Colour palette Colour scheme Colour scheme
Each category can set Colour and transparency (or opacity for a custom icon), marker type, outline (Circle), marker size, icon rotation (Icon) Colour and transparency, line pattern Fill colour and transparency, fill pattern
Same for the whole layer Size from a numeric field, if you set one Line width, casing, cap, and join Outline: Stroke (None, Solid, Dashed, or Dotted), stroke colour, and stroke width

On a point layer, colour comes from the category, but size does not. Give each category a fixed marker size in Customise categories, or size markers by a numeric field. With a size field, the legend shows the category swatches with a size key below them. See How to size points by a number.

Open the Style tab

In the layer panel, select your layer. Click the Style tab.

Pick the field in the colour driver

Open the colour driver. The table above gives its name for each geometry. The list starts with the no-field option, then shows every field on the dataset. Point layers with Circle markers also list Colour by zoom; see How to change marker colour by zoom level.

Pick your field. A text field shows the category controls straight away. A numeric field needs one more step.

Style section of the Airports — Category point layer: Colour markers by set to the text field type, a note that 8 categories have custom symbology, Colour palette, opacity and outline, Size markers by, and Customise categories with rows for major, major and military, and mid
Style section of the Roads — Category line layer: Colour lines by set to the text field class, with Colour scheme, opacity at 100%, line width 2.5 px, More line settings, and Customise categories open below it with rows Motorway, Motorway link, Trunk road, Trunk link, and Primary road
Style section of the Countries — Income Group polygon layer: Fill polygons by set to the text field income_grp, with Colour scheme, opacity, fill pattern, Stroke, and Customise categories with rows for the income groups

Set Style as to Categories (numeric fields only)

A numeric field starts as 5 classes. Open the Style as dropdown and pick Categories.

Style section of the Centroids — GDP point layer, Colour markers by set to gdp_pc, with the Style as dropdown open: Continuous, Categories, and 3 classes to 9 classes, 5 classes selected
Style section of the Roads — Quantity line layer, Colour lines by set to length_m, with the Style as dropdown open: Continuous, Categories, and 3 classes to 9 classes, 5 classes selected
Style section of the Countries — Population layer, Fill polygons by set to pop_est, with the Style as dropdown open: Continuous, Categories, and 3 classes to 9 classes, 5 classes selected

A 0/1 field styled this way, with a different marker on each row:

World Point Styling Lab as a viewer sees it with Major Cities — Megacities on: amber star icons for megacities and small faint grey circles for other cities, and the legend entry showing the two rows Megacity and Other city

Each distinct number becomes its own category. MangoMap does not round or group the values, so 1.5 and 2 are two categories.

Text fields have no Style as dropdown. They are always styled as categories.

Pick a colour palette

Open the palette dropdown. MangoMap gives the palette’s colours to the categories in list order. When there are more categories than colours, the colours repeat.

The opacity slider below the palette sets the opacity for the whole layer. On point and line layers, a category you customised keeps its own opacity. This includes a point category with a Custom Icon marker. Set its opacity in that row’s Opacity control.

Customise categories (optional)

Expand Customise categories. Each category has a row:

  • Swatch: click it to change how this category looks. The table at the top of this page lists the settings for each geometry.
  • Label: the text the legend shows. The data stays the same.
  • Eye icon: hide the category. Hidden categories do not draw on the map or show in the legend.
  • Drag handle: drag the row to change the legend order.
Customise categories expanded on the Airports — Category point layer: a row for each airport type, major to small, each with a drag handle, swatch, label, and eye icon, above the Save button
Customise categories expanded on the Roads — Category line layer: a row for each road type in road order, Motorway, Motorway link, Trunk road, and Trunk link to Tertiary road, each with a drag handle, line swatch, label, and eye icon
Customise categories expanded on the Countries — Income Group polygon layer: five rows, 1. High income: OECD to 5. Low income, each with a drag handle, fill swatch, label, and eye icon, above the Save button

You cannot add or remove categories, because the list comes from the data. Hide the ones you do not want. See How to customise category and class break symbology for the full flow.

Save

Click Save at the bottom of the panel. The map redraws with the chosen field and colours, and the legend shows one entry for each category.

World Point Styling Lab as a viewer sees it: airports coloured by type on the map, and the legend under Airports — Category listing major, major and military, mid, mid and military, military, military major, military mid, and small
Singapore Style Lab as a viewer sees it: roads coloured by road type on the map, with footways dotted and cycleways dashed, and the legend under Roads — Category listing one line swatch for each type, Motorway, Motorway link, and Trunk road to Footway, Steps, Path, and Track
World Atlas as a viewer sees it: countries coloured by income group on the map, and the legend under Countries — Income Group listing 1. High income: OECD to 5. Low income

If the legend shows a Null category

Features with no value in the field draw as one Null category. Rename it in Customise categories, or hide it to remove those features from the map and the legend.

If a category matches no features

A category draws only the features whose value matches it exactly, including upper and lower case. Residential and residential are two different values. A category that matches no feature stays in the list but draws nothing.

If the categories look out of date, to build them again from the data, set the colour driver to the no-field option (Single colour or Uniform colour), then pick the field again. This removes your category customisations, so note them first.

If the field has more than 50 values

A category style lists up to 50 values, in order: numbers from lowest to highest, text from A to Z. Any value past the first 50 draws as one Other category.

The palette repeats long before 50 values, so many categories become hard to tell apart. To keep the map readable:

If you switch Style as away from Categories

Picking Continuous or a class count in Style as removes every category customisation: labels, colours, hidden categories, and per-category symbols. If you switch back to Categories, MangoMap builds a new list. The old customisations do not come back.

Settle on Categories before you customise the rows.

Troubleshooting

The map didn’t redraw after I changed the field. Click Save. The map changes only when you save.

Some features aren’t drawing. A category may be hidden. Expand Customise categories and check the eye icons, including on Null and Other.

My numeric field shows classes, not one colour per value. Numeric fields start as 5 classes. Set Style as to Categories.

I can’t find the Style as dropdown. It shows only for numeric fields. A text field is always styled as categories.

My point layer has no Colour markers by dropdown. The marker type is Custom Icon or Heatmap. Switch Marker type to Circle or Icon.

Two categories have the same colour. The layer has more categories than the palette has colours. Change one category’s colour in Customise categories.

The legend shows 1500, not 1,500. Category labels show the raw value. Attribute number formatting does not apply to them. Type the label you want in Customise categories.