Open Map Tiles: Get started
1. Download Vector Tiles下載向量資料
Head over to the downloads page and download the vector tiles for your region or the planet.wget https://.../zurich_switzerland.mbtiles
2. Run a Tileserver 執行Tileserver
To serve the tiles to your mobile or web client you need to choose a tileserver for your platform and configure it to serve the previously downloaded vector tiles.
- Node.js
- Docker
- CDN
Using tileserver-gl you can immediately serve vector tiles including a web viewer and sample styles. 透過tileserver-gl,可以立刻提供向量圖磚服務,包含網頁瀏覽器與範例地圖樣式。
The light version tileserver-gl-light can be easily installed using npm. 可使用npm快速安裝tileserver-gl-light輕量級版本
npm install -g tileserver-gl-light
Now run tileserver-gl-light together with the previously downloaded vector tiles 執行tileserver-gl-light與先前下載的向量檔案
tileserver-gl-light zurich_switzerland.mbtiles
Open in your web browser the local address http://localhost:8080.
The full version of tileserver-gl has the capabilities to fall back to serve raster tiles for interoperability with other clients. The raster tiles are rendered on demand. This makes it harder to install, so we recommend usage of docker.
3. Choose a Style 選擇地圖樣式
Once you have your own vector tile server running you can choose one of the many stylessupporting the OpenMapTiles schema.
After you downloaded the style, point the endpoint URL to your tileserver and embedd it in a mobile app or web viewer. You can also create your own styles using Maputnik.
留言
張貼留言