On this page

    Prepare and add vector features to map: points, lines, polygons

    Vector features are geometric shapes that represent most objects on a map:

    • Simple points can represent single spots such as bus stops, lamps, trees,
    • Straight or curved lines can be used for paths, roads, or rivers,
    • Enclosed polygons cover large areas like buildings, forests, and lakes.

    Vector features are commonly used in maps but they’re also especially suitable for adding your own custom features.

    There are several different ways how you can prepare and add custom vector features 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 an interactive map using MapTiler SDK JS:

    How to add features to a static map (image):

    Use 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 vector tileset

    A vector tileset contains your custom vector features processed into vector 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, Engine can upload the finished tileset right to your MapTiler account, and then you can add it to your map:

    Was this helpful?

    Prepare and add vector features to map: points, lines, polygons
    Add vector data to map