kopia lustrzana https://github.com/osm2vectortiles/osm2vectortiles
Improve serve raster tiles tutorial
rodzic
b490ae5612
commit
b331a0c1d7
|
|
@ -9,14 +9,14 @@ published: true
|
|||
Get started styling and using vector tiles.
|
||||
|
||||
- Getting started
|
||||
- [Display map with tileserver-mapnik](/docs/start)
|
||||
- [Display map with Mapbox GL](/docs/display-map-with-mapbox-gl)
|
||||
- [Display Map with tileserver-mapnik](/docs/start)
|
||||
- [Display Map with Mapbox GL](/docs/display-map-with-mapbox-gl)
|
||||
- Create your own custom basemap
|
||||
- [Create a style with Mapbox Studio Classic](/docs/create-map-with-mapbox-studio-classic)
|
||||
- [Create a style with new Mapbox Studio](/docs/create-map-with-mapbox-studio)
|
||||
- [Create a Style with Mapbox Studio Classic](/docs/create-map-with-mapbox-studio-classic)
|
||||
- [Create a Style with new Mapbox Studio](/docs/create-map-with-mapbox-studio)
|
||||
- Hosting
|
||||
- [Serve raster tiles with Docker](/docs/serve-raster-tiles-docker)
|
||||
- [Serve vector tiles](/docs/serve-vector-tiles)
|
||||
- [Serve Raster Tiles with Docker](/docs/serve-raster-tiles-docker)
|
||||
- [Serve Vector Tiles](/docs/serve-vector-tiles)
|
||||
- [Use public CDN](/docs/use-public-cdn)
|
||||
|
||||
## Developer Documentation
|
||||
|
|
|
|||
|
|
@ -17,12 +17,18 @@ For a single map you can serve up to 50 users concurrently with a standard 4GB V
|
|||
### Download MBTiles
|
||||
|
||||
On the server download your desired extract of a country or the
|
||||
entire world MBTiles from http://osm2vectortiles.org/data/download.html.
|
||||
entire world MBTiles of the [Downloads page](/downloads).
|
||||
|
||||
```bash
|
||||
wget -c https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/world.mbtiles
|
||||
```
|
||||
|
||||
You can also download a smaller extract like Zurich.
|
||||
|
||||
```bash
|
||||
wget -c https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/zurich.mbtiles
|
||||
```
|
||||
|
||||
### Clone the Style Project
|
||||
|
||||
Clone your custom style project or in this example the official OSM Bright style.
|
||||
|
|
@ -47,13 +53,27 @@ The raster tiles will be exposed at port 8080 of your Docker host.
|
|||
docker run -v $(pwd):/data -p 8080:80 klokantech/tileserver-mapnik
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
If you visit your docker host on port 8080 you should see your map appearing
|
||||
in the interface. If you click on the map thumbnail you will get the configuration
|
||||
of different GIS clients and mapping libraries.
|
||||
|
||||

|
||||
|
||||
You can choose `Source code` in `Leaflet` to get the source code for a Leaflet layer.
|
||||
|
||||

|
||||
|
||||
You can get the configuration for the most common mapping libraries.
|
||||
|
||||
## Use the Map from Leaflet
|
||||
|
||||
The server will now provide a TileJSON endpoint at the service URL of the map.
|
||||
For this example the TileJSON endpoint is http://localhost/mapbox-studio-osm-bright/index.json.
|
||||
For this example the TileJSON endpoint is `http://localhost:8080/mapbox-studio-osm-bright/index.json`.
|
||||
You can reference this TileJSON endpoint in the leaflet configuration.
|
||||
|
||||
The HTML file will display a fullscreen Leaflet map using the raster tiles from our
|
||||
The HTML file will display a full screen Leaflet map using the raster tiles from our
|
||||
raster tile server as a base layer. You can now add additional layer on top of it or add interactivity.
|
||||
|
||||
```html
|
||||
|
|
@ -76,7 +96,7 @@ raster tile server as a base layer. You can now add additional layer on top of i
|
|||
var map = L.mapbox.map('map', 'mapbox.light', {
|
||||
minZoom: 8,
|
||||
}).setView([46.806, 8.091], 8);
|
||||
var overlay = L.mapbox.tileLayer('http://localhost/mapbox-studio-osm-bright/index.json').addTo(map);
|
||||
var overlay = L.mapbox.tileLayer('http://localhost:8080/mapbox-studio-osm-bright/index.json').addTo(map);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ At lower zoom levels there is still some world data to make maps look good.
|
|||
- [Ukraine](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/ukraine.mbtiles)
|
||||
- [United Arab Emirates](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/united_arab_emirates.mbtiles)
|
||||
- [United Kingdom](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/united_kingdom.mbtiles)
|
||||
- [United States of America](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/united_states_of_america.mbtiles)
|
||||
- ~~[United States of America](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/united_states_of_america.mbtiles)~~
|
||||
- [Uruguay](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/uruguay.mbtiles)
|
||||
- [Uzbekistan](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/uzbekistan.mbtiles)
|
||||
- [Vanuatu](https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/vanuatu.mbtiles)
|
||||
|
|
|
|||
Plik binarny nie jest wyświetlany.
|
Po Szerokość: | Wysokość: | Rozmiar: 386 KiB |
Ładowanie…
Reference in New Issue