Skip to content

Commit

Permalink
Add using-with-openlayers document (#1150)
Browse files Browse the repository at this point in the history
Try to help #1132

---------

Co-authored-by: Yuri Astrakhan <[email protected]>
  • Loading branch information
sharkAndshark and nyurik authored Jan 24, 2024
1 parent 10903d2 commit 72a0a5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Using with Leaflet](using-with-leaflet.md)
- [Using with deck.gl](using-with-deck-gl.md)
- [Using with Mapbox](using-with-mapbox.md)
- [Using with OpenLayers](using-with-openlayers.md)
- [Recipes](recipes.md)
- [Tools](tools.md)
- [martin-cp bulk tile generation](martin-cp.md)
Expand Down
16 changes: 16 additions & 0 deletions docs/src/using-with-openlayers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Using with OpenLayers

[OpenLayers](https://github.com/openlayers/openlayers) is an open source library for creating interactive maps on the web. Similar to [MapLibre GL JS](https://maplibre.org/), it can also display image and vector map tiles served by Martin Tile Server.

You can integrate tile services from `martin` and `OpenLayers` with its [VectorTileLayer](https://openlayers.org/en/latest/apidoc/module-ol_layer_VectorTile-VectorTileLayer.html). Here is an example to add `MixPoints` vector tile source to an OpenLayers map.

```js
const layer = new VectorTileLayer({
source: new VectorTileSource({
format: new MVT(),
url: 'http://0.0.0.0:3000/MixPoints/{z}/{x}/{y}',
maxZoom: 14,
}),
});
map.addLayer(layer);
```

0 comments on commit 72a0a5d

Please sign in to comment.