Issue #69: add tile server example.

This commit is contained in:
Sergey Vartanov 2021-08-28 19:05:57 +03:00
parent 2ec6a106e9
commit 00f97131f2
2 changed files with 54 additions and 0 deletions

View file

@ -229,6 +229,35 @@ roentgen server
Stop server interrupting process with <kbd>Ctrl</kbd> + <kbd>C</kbd>.
### Example ###
Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19:
```bash
roentgen tile -b 2.364,48.854,2.367,48.857 -s 16-19
```
Run tile server on 127.0.0.1:8080:
```bash
roentgen server
```
Use JavaScript code for [Leaflet](https://leafletjs.com/):
```js
zxy', {
maxZoom: 19,
attribution: 'Map data &copy; ' +
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
'contributors, imagery &copy; ' +
'<a href="https:/github.com/enzet/Roentgen">Röntgen</a>',
id: 'roentgen',
tileSize: 256,
zoomOffset: 0
}).addTo(map);
```
Map options
-----------

View file

@ -244,6 +244,31 @@ Command \m {server} is used to run tile server for slippy maps.
Stop server interrupting process with \kbd {Ctrl} + \kbd {C}.
\3 {Example} {example}
Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19\:
\code {roentgen tile -b 2.364,48.854,2.367,48.857 -s 16-19} {bash}
Run tile server on 127.0.0.1\:8080\:
\code {roentgen server} {bash}
Use JavaScript code for \ref {https://leafletjs.com/} {Leaflet}\:
\code {var map = L.map('mapid').setView([48.8555, 2.3655], 18);
L.tileLayer('http://127.0.0.1:8080/tiles/{z}/{x}/{y}', \{
maxZoom: 19,
attribution: 'Map data &copy; ' +
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
'contributors, imagery &copy; ' +
'<a href="https:/github.com/enzet/Roentgen">Röntgen</a>',
id: 'roentgen',
tileSize: 256,
zoomOffset: 0
\}).addTo(map);} {js}
\2 {Map options} {map-options}
Map configuration options used by \m {render} and \m {tile} commands: