Prepare and use custom vector data
This page explains the different ways how you can prepare and add custom vector features (points, lines, polygons) to your map. Selecting the best way depends mainly on whether you have the features ready in some format or not, and how many you need to add. Let’s look at the options, from simplest to most complex.
Add features directly
The easiest way is to define your features right in the map code or URL. It’s useful if you only need to add a few simple features to your map, such as a couple of markers (pins) to show where something is, or lines showing how to get from place A to place B. You don’t have to create any data file; all you need is the coordinates of whatever you want to show on the map. If your use case is more complex than that, it’s better to create a vector file to keep your data separate.
👉 How to add features to a static map (image):
👉 How to add features to an interactive map using MapTiler SDK JS:
Use a vector data file
Another way of adding vector features to a map is to link a separate file in compatible format, typically GeoJSON. This keeps your data decoupled from the app code and thus easier to maintain, share, and reuse. It becomes practical especially if you have many complex features. 👉 To prepare a vector data file, use our friendly no-code Vector data editor.
Use a vector tileset
A vector tileset contains your custom vector features processed into map tiles. This processing is required if a simple vector file would exceed the size limit.
To prepare a vector tileset, use our geoprocessing tool MapTiler Engine. After tiling, it can upload the finished tileset right to your MapTiler account, and then you can add it to your map:
- Add the data programmatically using MapTiler SDK JS
- Add the data without coding in our visual editor Map Designer