Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
Go to file
Andrew Calcutt d68ab38442
Add support for 512 sized raster tiles - v2 (#1136)
* test: using 512px rendered tiles

Based on https://github.com/maptiler/tileserver-gl/pull/495

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: use static renderer at zoom 0

renderer is not able to change the size of tile to more than 512px in tile mode

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Add support for 512 sized raster tiles (#1)

* Enable setting tilesize for raster tiles

* Serve correct endpoint for raster tiles

* Add 256 & 512 sized raster layers to wmts getCapabilities document

* Update wmts getCapabilities tileMatrixSets

* Add rendered tiles format for getTileUrls method

* Update endpoints documentation

* Add and fix tiles_rendered tests

* fix: formatting

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: corrent bad merge

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: if tile size is undefined don't add it

needed for data endpoint right now

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set tile size in raster endpoints to 512

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: add semicolon

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: test z1 512px file that actually exists

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: make tileSize optional

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: cleaner if statement

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: update tileSize to show as optional

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: allow tile size in data url

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove unneeded tileSize

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set data as 256 tileSize for consistency

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: add note about optional data tileSize

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Revert "fix: remove unneeded tileSize"

This reverts commit a4583161bf53653d65a4606c407ba9b5249d1061.

* fix: allow tile size to be set at json endpoints

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: set default endpoint tilesizes

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: don't use tilesize one data endpoint

It doesn't do anything

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: default style endpoint to undefined

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: zoom 0 workaround

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* Revert "fix: zoom 0 workaround"

This reverts commit 0f3bbd765c9c151016cec66768675f990676c8b3.

* fix: limit min zoom to 1 in viewer

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: put back orig string

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* docs: add optional tilesize to TileJSON

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: cleanup thumbnails

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: default undefined like other data endpoints

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: move data xyz_link

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: remove console.log

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: lint

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* chore: update version

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: update path

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: join error

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

* fix: revert path change

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>

---------

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Petteri Pesonen <teemu.p.pesonen@gmail.com>
2024-01-25 21:23:07 -05:00
.github Update Maplibre-Native to v5.3.0 (#1124) 2024-01-15 17:46:22 -05:00
.husky style: fix lint issues in code 🕺 (#626) 2022-11-08 22:56:07 -05:00
docs Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
public Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
src Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
test Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
.dockerignore Move docker images to ubuntu (#620) 2022-10-05 09:11:03 -04:00
.eslintignore build: add CI workflow 🕺 (#671) 2023-01-10 10:01:26 -05:00
.eslintrc.cjs chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.11.0 (#1052) 2023-11-15 21:31:28 -05:00
.gitattributes Add .gitattribute (#637) 2022-11-06 18:08:26 -05:00
.gitignore Experimental integration of first plugin 2016-12-06 20:11:18 +01:00
.hadolint.yml build: add CI workflow 🕺 (#671) 2023-01-10 10:01:26 -05:00
.nvmrc chore: add.nvmrc & cache Docker build(s) 📦 (#707) 2023-01-13 14:05:44 -05:00
.prettierignore build: add CI workflow 🕺 (#671) 2023-01-10 10:01:26 -05:00
.readthedocs.yaml fix: try to get readthedocs working 2023-09-27 01:00:45 -04:00
commitlint.config.cjs style: fix lint issues in code 🕺 (#626) 2022-11-08 22:56:07 -05:00
docker-entrypoint_light.sh Simplify signal handling (#771) 2023-02-18 23:51:48 -05:00
docker-entrypoint.sh fix: Failed to open X display when restarting container (#790) 2023-03-19 11:04:34 -04:00
Dockerfile Update Maplibre-Native to v5.3.0 (#1124) 2024-01-15 17:46:22 -05:00
Dockerfile_light Update Maplibre-Native to v5.3.0 (#1124) 2024-01-15 17:46:22 -05:00
Dockerfile_test Update Maplibre-Native to v5.3.0 (#1124) 2024-01-15 17:46:22 -05:00
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md 2018-01-23 12:17:14 +01:00
LICENSE.md Add pmtiles support (#1009) 2023-10-15 03:03:15 -04:00
lint-staged.config.cjs style: fix lint issues in code 🕺 (#626) 2022-11-08 22:56:07 -05:00
package-lock.json Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
package.json Add support for 512 sized raster tiles - v2 (#1136) 2024-01-25 21:23:07 -05:00
prettier.config.cjs style: fix lint issues in code 🕺 (#626) 2022-11-08 22:56:07 -05:00
publish.js fix: issue with husky install (#639) 2022-11-09 15:39:28 -05:00
PUBLISHING.md Update publishing (#616) 2022-09-28 16:39:26 -04:00
README_light.md Add undocumented options to docs (#1063) 2023-11-22 10:35:14 -05:00
README.md fix: update recommended node version 2024-01-15 23:53:03 -05:00

tileserver-gl

TileServer GL

GitHub Workflow Status Docker Hub

Vector and raster maps with GL styles. Server-side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.

Download vector tiles from OpenMapTiles.

Getting Started with Node

Make sure you have Node.js version 18.17.0 or above installed. Node 20 is recommended. (running node -v it should output something like v20.x.x). Running without docker requires Native dependencies to be installed first.

Install tileserver-gl with server-side raster rendering of vector tiles with npm.

npm install -g tileserver-gl

Once installed, you can use it like the following examples.

using a mbtiles file

wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/zurich_switzerland.mbtiles
tileserver-gl --file zurich_switzerland.mbtiles
[in your browser, visit http://[server ip]:8080]

using a config.json + style + mbtiles file

wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
unzip test_data.zip
tileserver-gl
[in your browser, visit http://[server ip]:8080]

Alternatively, you can use the tileserver-gl-light npm package instead, which is pure javascript, does not have any native dependencies, and can run anywhere, but does not contain rasterization on the server side made with Maplibre GL Native.

Getting Started with Docker

An alternative to npm to start the packed software easier is to install Docker on your computer and then run from the tileserver-gl directory

Example using a mbtiles file

wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/zurich_switzerland.mbtiles
docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl --file zurich_switzerland.mbtiles
[in your browser, visit http://[server ip]:8080]

Example using a config.json + style + mbtiles file

wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
unzip test_data.zip
docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl
[in your browser, visit http://[server ip]:8080]

Example using a different path

docker run --rm -it -v /your/local/config/path:/data -p 8080:8080 maptiler/tileserver-gl

replace '/your/local/config/path' with the path to your config file

Alternatively, you can use the maptiler/tileserver-gl-light docker image instead, which is pure javascript, does not have any native dependencies, and can run anywhere, but does not contain rasterization on the server side made with Maplibre GL Native.

Getting Started with Linux cli

Test from command line

wget https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
unzip -q test_data.zip -d test_data
xvfb-run --server-args="-screen 0 1024x768x24" npm test

Run from command line

xvfb-run --server-args="-screen 0 1024x768x24" node .

Documentation

You can read the full documentation of this project at https://maptiler-tileserver.readthedocs.io/.

Alternative

Discover MapTiler Server if you need a map server with easy setup and user-friendly interface.