A simple tile service, that takes one or more GeoJSON files and offers them as slippy maps in MVT, VT or GeoJSON format.
npm install geojson-tile-serverdata folder containing two GeoJSON files (layer1.geojson and layer2.geojson), you can access the tiles at http://localhost:8123/layer1/z/x/y.geojson and http://localhost:8123/layer2/z/x/y.geojson, where z = zoom, x and y need to be replaced by some sensible value based on the bounding box of your dataset.
geojson extension with mvt, e.g. http://localhost:8123/layer1/z/x/y.mvt.
console
npm i -g geojson-tile-server
`
$3
`bash
git clone https://github.com/TNOCS/geojson-tile-server.git
cd geojson-tile-server
npm i
npm start
`
The source contains a small dataset containing some building contours in Amersfoort, The Netherlands. You can test that it is working by going to:
- GeoJSON example
- VT example
- MVT playground on flems.io: You need to insert your own Mapbox GL access key in order to make this work.
Usage
To start the development service, run:
`bash
npm start
`
Or if you've installed it globally, run geojson-tile-server, which by default serves the './data' folder with the GeoJSON files, and the ./public folder with static files.
Optionally, you can specify the PORT (default 8123), DATA (default ./data), and PUBLIC_FOLDER (default ./public`) folder in your environment, in which case those values will be used instead.