Node Tile Server

v1.0.0

Designed for serving map tiles stored in files with XYZ schema or MBTiles. Node Tile Server can be used as a HTTP server. When the server is running you can access the tiles from different mapping applications.

Contents

How to use

When started, the server provides two options:

When started, the server can be accessed on:

http://localhost:9956

The server also provides you with the option to preview each of the available tiles by navigating to:

http://localhost:9956/preview/tiles/{tile name}

or for MBTiles:

http://localhost:9956/preview/mbtiles/{tile name}

Access to local Map Tiles

Local tiles must be located in public directory. Refer to local map tiles for more information on how to structure your local tile files.

Local map tiles can be accessed on address:

http://localhost:9956/tiles

On this address you will get information about available tiles:

Available directories with tiles

This is a list of all directories, containing tiles and are served from this service:

Property Value
Min Zoom 1
Max Zoom 10
URL Template http://localhost:9956/tiles/default/{z}/{x}/{y}

Access to local MBTiles files

Local MBTiles files must be located in public directory. Refer to MBTiles files for more information on how to structure your MBTiles files.

Local MBTiles files can be accessed on address:

http://localhost:9956/mbtiles

On this address you will get information about available MBTiles files:

Available MBTiles files

This is a list of all MBTiles files, served from this service:

Property Value
Version 1.1
Description BG
Type overlay
Format png
Min Zoom 1
Max Zoom 12
Scheme xyz
Bounds 23.119626693369888, 42.56456404303669, 23.559748137141618, 42.828222356154384
Center 23.339687415255753, 42.69639319959553, 6
URL Template http://localhost:9956/mbtiles/default.mbtiles/{z}/{x}/{y}

Examples

This servер can be used from any mapping application, which supports loading of tiles with XYZ tiling scheme. Here is an example use in QGIS. In QGIS you can add a new XYZ Tiles source and then load it in the map.

With QGIS

  1. Clone this project
  2. Prepare your tiles
  3. Run the server
  4. Add a new XYZ Tile source in QGIS Browser using Python Console:
title = 'Local MBTiles'
referer = 'Tiles are loaded from Node Tile Server Service'
url = 'http://localhost:9956/mbtiles/default.mbtiles/{z}/{x}/{y}'
min_zoom = 1
max_zoom = 12

prefix = "qgis/connections-xyz/{0}".format(title)
QSettings().setValue("{0}/url".format(prefix), url)
QSettings().setValue("{0}/referer".format(prefix), referer)
QSettings().setValue("{0}/zmin".format(prefix), min_zoom)
QSettings().setValue("{0}/zmax".format(prefix), max_zoom)

iface.reloadConnections()

Or local XYZ tiles:

title = 'Local Tiles'
referer = 'Tiles are loaded from Node Tile Server Service'
url = 'http://localhost:9956/tiles/default/{z}/{x}/{y}'
min_zoom = 1
max_zoom = 10

prefix = "qgis/connections-xyz/{0}".format(title)
QSettings().setValue("{0}/url".format(prefix), url)
QSettings().setValue("{0}/referer".format(prefix), referer)
QSettings().setValue("{0}/zmin".format(prefix), min_zoom)
QSettings().setValue("{0}/zmax".format(prefix), max_zoom)

iface.reloadConnections()