---
title: "Static map with lines or polygons | Guides | Maps apis | Static maps"
description: "Generate static map images with custom lines or area polygons."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Static map with lines or polygons

To add lines or polygons to your [static map](https://docs.maptiler.com/guides/maps-apis/static-maps/static-maps-for-your-web/), specify coordinates of the individual path vertices as comma-separated lng, lat pairs. To get the coordinates, use our [Coordinates finder](https://www.maptiler.com/tools/coordinates) tool.

You can add multiple lines by using the path parameter several times. Separate the vertices by a pipe symbol `|`.

Specify styling before the path coordinates using `key:value` format:

-   **fill** – Fill color: `red`, `rgba(255,255,255,0.5)`, `#0000ff` (default: `rgba(255, 255, 255, 0.5)`). To draw lines without fill, set the fill property to `none` or `false`.
-   **stroke** – Stroke color (default: `blue`)
-   **width** – Stroke width in pixels (default: `1`)
-   **shortest** – Draw the shortest paths, crossing the dateline if needed.
-   **enc** – Path encoded with [Google Encoded Polyline Format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) (optional):
    -   Example: `_p~iF~ps|U_ulLnnqC_mqNvxq@`
    -   If used, the rest of the path parameter is considered to be part of the encoded polyline string – do not specify the coordinate pairs.

You can also use `fill`, `stroke`, `width` and `shortest` as separate query parameters to specify default styling for all the paths.

## Examples

Use a line to indicate how to get from a parking lot to a restaurant:

[https://api.maptiler.com/maps/streets-v4/static/auto/825x350.png?key=YOUR\_MAPTILER\_API\_KEY\_HERE\\&path=fill:none|width:3|stroke:red|2.1699929237365723,41.40282721444188|2.1697568893432617,41.40266626487097|2.1708834171295166,41.401801154097434|2.172026038169861,41.40266224112659|2.173168659210205,41.40181724928674|2.1750354766845703,41.403217515495896](https://api.maptiler.com/maps/streets-v4/static/auto/825x350.png?key=mNLmXyaTH4gRlwJHSYWp&path=fill:none|width:3|stroke:red|2.1699929237365723,41.40282721444188|2.1697568893432617,41.40266626487097|2.1708834171295166,41.401801154097434|2.172026038169861,41.40266224112659|2.173168659210205,41.40181724928674|2.1750354766845703,41.403217515495896)

![make map with a line to get from a parking lot to a restaurant](../img/4491445112337_00666f5efb.webp)

Add multiple colored lines:

[https://api.maptiler.com/maps/base-v4/static/auto/825x350.png?key=YOUR\_MAPTILER\_API\_KEY\_HERE\\&path=fill:none|width:3|stroke:red|2.1751588582992554,41.40390556628419|2.1745795011520386,41.404336097282346|2.17429518699646,41.40427171899671|2.174190580844879,41.40433408546189|2.1740511059761047,41.4042314825358\\&path=fill:none|width:3|stroke:blue|2.1751856803894043,41.403909589951574|2.1755397319793697,41.40361586157709|2.17429518699646,41.402710526042696](https://api.maptiler.com/maps/base-v4/static/auto/825x350.png?key=mNLmXyaTH4gRlwJHSYWp&path=fill:none|width:3|stroke:red|2.1751588582992554,41.40390556628419|2.1745795011520386,41.404336097282346|2.17429518699646,41.40427171899671|2.174190580844879,41.40433408546189|2.1740511059761047,41.4042314825358&path=fill:none|width:3|stroke:blue|2.1751856803894043,41.403909589951574|2.1755397319793697,41.40361586157709|2.17429518699646,41.402710526042696)

![create-map-with-multiple-lines.png](../img/7922420387985_2a4f48d1b7.webp)

Use a polygon to highlight a real estate property:

[https://api.maptiler.com/maps/hybrid-v4/static/-80.40494,26.11650,16/825x350.png?key=YOUR\_MAPTILER\_API\_KEY\_HERE\\&path=width:3|stroke:rgba(255,170,1,1)|-80.40516972541809,26.11666628740777|-80.40514826774597,26.116630162087464|-80.40510803461075,26.116547073808373|-80.40506646037102,26.116436289344406|-80.40499940514565,26.116255662275762|-80.40496319532393,26.116255662275762|-80.40483713150024,26.116313462968083|-80.40466278791428,26.116457964573883|-80.40470570325851,26.11651456098744|-80.40483176708221,26.116654245635566|-80.40503025054932,26.116740946367674|-80.40506646037102,26.116704821070446|-80.40516972541809,26.11666628740777](https://api.maptiler.com/maps/hybrid-v4/static/-80.40494,26.11650,16/825x350.png?key=mNLmXyaTH4gRlwJHSYWp&path=width:3|stroke:rgba\(255,170,1,1\)|-80.40516972541809,26.11666628740777|-80.40514826774597,26.116630162087464|-80.40510803461075,26.116547073808373|-80.40506646037102,26.116436289344406|-80.40499940514565,26.116255662275762|-80.40496319532393,26.116255662275762|-80.40483713150024,26.116313462968083|-80.40466278791428,26.116457964573883|-80.40470570325851,26.11651456098744|-80.40483176708221,26.116654245635566|-80.40503025054932,26.116740946367674|-80.40506646037102,26.116704821070446|-80.40516972541809,26.11666628740777)

![make a map image with a polygon to highlight a real state property](../img/4491481414033_c21ed4f29e.webp)
