Documentation → Tutorials
Your first map
This tutorial takes a spatial file from upload to a published map in about twenty minutes, most of it spent waiting for tiles to build. Bring any spatial file you already have.
Before you start
- A mapbench account, and a project to work in. Accounts are created by invitation, so request access if you do not have one.
- A vector spatial file: GeoJSON, GeoPackage, FlatGeobuf, a zipped Shapefile, KML/KMZ, CSV with coordinates, GML or GPX. Anything up to 1 GiB. Formats and limits has the full list.
- If you have nothing to hand, most national and state agencies publish administrative boundaries as GeoJSON. A small file of a few thousand features keeps this first run quick.
Step 1. Add a dataset
- Sign in and choose Datasets in the sidebar.
- Choose New, then From file.
- Enter a Name. This is what the catalogue shows, for example Parks.
- Set the Layer name. This name is stored in the tiles
themselves, so use lower case with underscores, for example
parks. You can't change it later (see the note below). - Drop the file onto the upload area, or click to browse.
- Choose Upload & Queue.
The layer name is permanent. Published maps and embeds refer to it, so mapbench can't rename it afterwards. You can change the Name at any time. If you get the layer name wrong, you'll need to create a new dataset, so choose a short, plain name now.
A Shapefile is made up of several files. Zip the
.shp, .shx, .dbf and .prj
together and upload the .zip. If you upload the .shp on
its own, the dataset will have no attributes and no coordinate system.
Step 2. Wait for it to tile
Building the tiles takes longer than the upload. The dataset appears in the catalogue right away and moves through these states:
| State | What is happening |
|---|---|
| Pending | Queued and waiting to start. |
| Processing | Fetching, converting to a common format, tiling, then uploading the tiles. |
| Ready | Tiles exist. The dataset can go on a map. |
| Error | Something failed. The job shows the error message and the log. |
Open the processing panel from the Datasets page to watch progress, read a failed job's log, cancel a queued job or queue a Reprocess. A few thousand features take seconds. A few million take minutes.
The most common causes of failure are an unreadable or incomplete Shapefile bundle, a file where mapbench couldn't find a geometry column, and a file that doesn't declare a coordinate reference system. Fix the file and upload it again.
Step 3. Check the dataset
Select the dataset in the catalogue and check two things before you build on it:
- The preview rows show the attribute table as stored. Use them to check what your fields are called.
- The field statistics show each field's type, range and common values. The style editor offers these fields when you colour by a field, so you can't style by a field that is missing here.
While you are here, fill in the description, the licence and the attribution under Edit dataset. mapbench doesn't require them, but many open data licences require attribution, and the share page can only show a credit you have recorded.
Step 4. Style it
Styling is set on the dataset, so each map that uses it starts with the same look. Set fill and stroke colours, opacity, width and point size. Where it helps, base one of these on a field so that the colour shows something about the data.
The dataset's style is the default. You can override it for a layer on one map, and Reset to the dataset's style in the map editor restores the default.
Step 5. Build the map
- Choose Maps in the sidebar, then New map.
- Pick a basemap.
- In the dataset picker, choose Add to map next to the dataset you just made. You can add as many datasets as you want, one above another.
- In the layer panel, drag to reorder (the top of the list draws on top), toggle visibility, zoom to a layer, or override its style for this map.
- Set the map's name and description, and save the view. Visitors open the map at the centre and zoom you save.
Write a description. It's the only text a visitor sees on a published map, so use it to explain anything the styling encodes, such as what each fill colour means.
Step 6. Publish it
- Choose Share map.
- Choose Create share link.
- Copy the share link (a full-page map with a title and a preview card) or the embed code for another site.
A share link is public. Anyone with the URL can view all the layers in the map without signing in, and there is no password. If you revoke the link from the same dialog, access ends immediately.
Publish and share a map covers embedding, rotating a link and what viewers can do with it.
Where to go next
- Import data from a service: pull layers directly from ArcGIS or WFS without downloading files first.
- Query and model data with SQL: join, aggregate and filter your datasets to make new ones.
- Connect Claude to mapbench: have an agent do these tasks with your data.
- Formats, limits and quotas: which formats mapbench accepts and the size limits and quotas that apply.