https://github.com/stopyransky/mapbox-server
Node.js server that allows to fetch, save and stitch together locally multiple Mapbox tiles described with given bounding box (lat lon coordinates), zoom level and map type.
https://github.com/stopyransky/mapbox-server
mapbox server service terrain-rgb texture tiles
Last synced: 2 months ago
JSON representation
Node.js server that allows to fetch, save and stitch together locally multiple Mapbox tiles described with given bounding box (lat lon coordinates), zoom level and map type.
- Host: GitHub
- URL: https://github.com/stopyransky/mapbox-server
- Owner: stopyransky
- License: mit
- Created: 2021-03-25T10:29:53.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-25T11:10:08.000Z (about 4 years ago)
- Last Synced: 2025-01-22T13:51:41.449Z (4 months ago)
- Topics: mapbox, server, service, terrain-rgb, texture, tiles
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Getting started
Server runs on port 6767,
it connects to mapbox api with given MAPBOX_TOKEN and via this api provides following routes## Before running
1. create own .env file with MAPBOX_TOKEN (from https://account.mapbox.com/)
```
// .env
MAPBOX_TOKEN={your token here}
```2. install nodemon globally
```
npm i -g nodemon
```3. install dependencies
```
npm install```
# Routes
## /mapbox
Retrieves and saves locally all tiles defined by bounding box set in the url query expressed in lon/lat value
**query params:**
n = north edge
e = east edge
w = west edge
s = south edge
z = zoom level as in mapbox (0-21)
t = type of map ( for example satellite, terrain-rgb)example of query:
http://localhost:6767/mapbox?n=28.61&e=-16.11&s=27.99&w=-16.93&z=2&t=terrain-rgbFiles are saved in ./assets directory.
## /texture
Stitches together given tiles ands saves stiched file as a one texture
> NOTE: /mapbox route neeeds to be called first to save the tiles)
**query params:**
type = satellite or terrain-rgb (and other accepted mapbox types)
zoom = number, typically 0-21 describing zoom levelexample of query:
http://localhost:6767/texture?type=terrain-rgb&zoom=2File is saved in ./assets directory.