-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add using-with-openlayers document (#1150)
Try to help #1132 --------- Co-authored-by: Yuri Astrakhan <[email protected]>
- Loading branch information
1 parent
10903d2
commit 72a0a5d
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` |