Skip to content

Commit

Permalink
polygon support
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichmax committed Jan 3, 2025
1 parent 537e426 commit 0e6fc89
Showing 1 changed file with 46 additions and 38 deletions.
84 changes: 46 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ The `polylineStyle` consists of the following two parameters separated by `|`.

If no `center` is specified, the polyline will be centered.

**Usage example**

<details>
<summary>Polyline with no `zoom`, `weight:6` and `color:0000ff`</summary>
<p>
```http://localhost:3000/staticmaps?width=600&height=600&polyline=weight:6|color:0000ff|48.726304979176675,-3.9829935637739382|48.72623035828412,-3.9829726446543385|48.726126671101639,-3.9829546542797467|48.725965124843256,-3.9829070729298808|48.725871429380568,-3.9828726793245273|48.725764250990267,-3.9828064532306628|48.725679557682362,-3.9827385375789146|48.72567025076134,-3.9827310750289113|48.725529844164292,-3.9826617613709225|48.725412537198615,-3.9826296635284164|48.725351694726704,-3.9826201452878531|48.725258599474508,-3.9826063049230411|48.725157520450125,-3.9825900299314232|48.725077863838543,-3.9825779905509102|48.724930435729831,-3.9825514102373938|48.724815578113535,-3.9825237355887291|48.724760905376989,-3.9825013965800564|48.724677938456551,-3.9824534296566916|48.724379435330384,-3.9822469276001118|48.724304509274596,-3.9821850264836076|48.7242453124599,-3.9821320570321772|48.724206187829317,-3.9821063430223207|48.724117073204575,-3.9820862134785551```
</p>
</details>

![Polyline with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/polylinepath.png)

### Polygons

With the parameter `polygon` you can add a polgon to the map in the following format:
Expand All @@ -82,6 +93,17 @@ The `polygonStyle` consists of the following two parameters separated by `|`.

If no `center` is specified, the polygon will be centered.

**Usage example**

<details>
<summary>Polygon with no `zoom`, `color:4874db`,`weight:7` and `fill:eb7a3`</summary>
<p>
```http://localhost:3000/staticmaps?width=600&height=600&polygon=color:4874db|weight:7|fill:eb7a34|41.891169,12.491691|41.890633,12.493697|41.889012,12.492989|41.889467,12.490811|41.891169,12.491691```
</p>
</details>

![polygon with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/polygonexample.png)

### Markers

With the parameter `markers` you can draw one or multiple markers depending on how much pair of coordinates you pass to the parameter
Expand All @@ -92,6 +114,17 @@ With the parameter `markers` you can draw one or multiple markers depending on h

If no `center` is specified, the markers will be centered.

**Usage example**

<details>
<summary>Markers</summary>
<p>
```http://localhost:3000/staticmaps?width=600&height=600&markers=48.726304979176675,-3.9829935637739382|48.724117073204575,-3.9820862134785551```
</p>
</details>

![Markers with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/markers.png)

### Circles

With the parameter `circle` you can add a circle to the map in the following format:
Expand All @@ -109,7 +142,19 @@ The `circleStyle` consists of the following parameters seperated by `|`.

If no `center` is specified, the circle will be centered.

### Usage Examples
**Usage example**

<details>
<summary>Circle with no zoom</summary>
<p>
```http://localhost:3000/staticmaps?width=600&height=600&basemap=osm&circle=radius:100|48.726304979176675,-3.9829935637739382```
</p>
</details>

![No zoom, `polyline=true`, `markers=false`](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/circle.png)


### MoreuUsage examples

<details>
<summary>Minimal example: `center` and `zoom`</summary>
Expand All @@ -125,33 +170,6 @@ If no `center` is specified, the circle will be centered.

![example request 2](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/example2.webp "example request 2")

<details>
<summary>Polyline with no `zoom`, `weight:6` and `color:0000ff`</summary>
<p>
http://localhost:3000/staticmaps?width=600&height=600&polyline=weight:6|color:0000ff|48.726304979176675,-3.9829935637739382|48.72623035828412,-3.9829726446543385|48.726126671101639,-3.9829546542797467|48.725965124843256,-3.9829070729298808|48.725871429380568,-3.9828726793245273|48.725764250990267,-3.9828064532306628|48.725679557682362,-3.9827385375789146|48.72567025076134,-3.9827310750289113|48.725529844164292,-3.9826617613709225|48.725412537198615,-3.9826296635284164|48.725351694726704,-3.9826201452878531|48.725258599474508,-3.9826063049230411|48.725157520450125,-3.9825900299314232|48.725077863838543,-3.9825779905509102|48.724930435729831,-3.9825514102373938|48.724815578113535,-3.9825237355887291|48.724760905376989,-3.9825013965800564|48.724677938456551,-3.9824534296566916|48.724379435330384,-3.9822469276001118|48.724304509274596,-3.9821850264836076|48.7242453124599,-3.9821320570321772|48.724206187829317,-3.9821063430223207|48.724117073204575,-3.9820862134785551
</p>
</details>

![Polyline with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/polylinepath.png)

<details>
<summary>Polygon with no `zoom`, `color:4874db`,`weight:7` and `fill:eb7a3`</summary>
<p>
http://localhost:3000/staticmaps?width=600&height=600&polygon=color:4874db|weight:7|fill:eb7a34|41.891169,12.491691|41.890633,12.493697|41.889012,12.492989|41.889467,12.490811|41.891169,12.491691
</p>
</details>

![polygon with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/polygonexample.png)

<details>
<summary>Markers</summary>
<p>
http://localhost:3000/staticmaps?width=600&height=600&markers=48.726304979176675,-3.9829935637739382|48.724117073204575,-3.9820862134785551
</p>
</details>

![Markers with no zoom](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/markers.png)

<details>
<summary>Markers and Polyline</summary>
<p>
Expand All @@ -162,16 +180,6 @@ If no `center` is specified, the circle will be centered.
![No zoom, polyline and marker`](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/markersandpolyline.png)


<details>
<summary>Circle with no zoom</summary>
<p>
http://localhost:3000/staticmaps?width=600&height=600&basemap=osm&circle=radius:100|48.726304979176675,-3.9829935637739382
</p>
</details>

![No zoom, `polyline=true`, `markers=false`](https://raw.githubusercontent.com/dietrichmax/docker-staticmaps/refs/heads/main/examples/circle.png)


## Deployment

**with Docker**
Expand Down

0 comments on commit 0e6fc89

Please sign in to comment.