mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-04 04:36:54 +02:00
Issue #69: add tile server example.
This commit is contained in:
parent
2ec6a106e9
commit
00f97131f2
2 changed files with 54 additions and 0 deletions
29
README.md
29
README.md
|
@ -229,6 +229,35 @@ roentgen server
|
||||||
|
|
||||||
Stop server interrupting process with <kbd>Ctrl</kbd> + <kbd>C</kbd>.
|
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 © ' +
|
||||||
|
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
||||||
|
'contributors, imagery © ' +
|
||||||
|
'<a href="https:/github.com/enzet/Roentgen">Röntgen</a>',
|
||||||
|
id: 'roentgen',
|
||||||
|
tileSize: 256,
|
||||||
|
zoomOffset: 0
|
||||||
|
}).addTo(map);
|
||||||
|
```
|
||||||
|
|
||||||
Map options
|
Map options
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
|
@ -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}.
|
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 © ' +
|
||||||
|
'<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> ' +
|
||||||
|
'contributors, imagery © ' +
|
||||||
|
'<a href="https:/github.com/enzet/Roentgen">Röntgen</a>',
|
||||||
|
id: 'roentgen',
|
||||||
|
tileSize: 256,
|
||||||
|
zoomOffset: 0
|
||||||
|
\}).addTo(map);} {js}
|
||||||
|
|
||||||
\2 {Map options} {map-options}
|
\2 {Map options} {map-options}
|
||||||
|
|
||||||
Map configuration options used by \m {render} and \m {tile} commands:
|
Map configuration options used by \m {render} and \m {tile} commands:
|
||||||
|
|
Loading…
Add table
Reference in a new issue