Mobile Tile Server app
Mobile Tile Server can be used as a HTTP server, serving Map Tiles from the device storage. When the server is running you can access the tiles from different mapping applications.
The application provides four main options:
- Access of local Map Tiles
- Access of local MBTiles files
- Redirect to a Tile Server with QuadKey Tile schema
- Access static files
Access to local Map Tiles
Local Map Tiles can be accessed on address: http://localhost:PORT/tiles
– where PORT is set in application settings. In settings, you must specify a directory, where the files are stored. This directory is used as a root for the server. All files in that directory (including subdirectories) will be accessible from the server.
Example: If you have map tiles stored in /storage/emulated/0/MobileTileServer/tiles/Plovdiv/{z}_{x}_{y}.png
, you can set the root directory to: /storage/emulated/0/MobileTileServer
. Then in order to access this map just start the service and navigate to: http://localhost:PORT/tiles/Plovdiv/{z}_{x}_{y}.png
.
In this case the root directory points to the parent folder (which contains ’Plovdiv’ subfolder). This way you can have multiple subfolders containing different map tiles and all can be accessed through the same server!
Access to local MBTiles files
… can be found on address: http://localhost:PORT/mbtiles
– where PORT is set in application settings. In settings, you must specify a directory, where the files are stored. This directory is used as a root for the server. All files in that directory (including subdirectories) will be accessible from the server.
As MBTiles use TMS schema to store map tiles, y coordinate must be transformed in order to locate the correct tile row. If your app uses XYZ tile schema, pass negative value for y (-y) as a parameter.
There are several parameters, which must be provided:
- ’file’: MBTiles file (including extension)
- ’z’: map zoom level
- ’x’: x coordinate of a map tile
- ’y’: y coordinate of a map tile
Example: If you have tiles stored in MBTiles format, you can place your files in the root directory and access them with: http://localhost:PORT/mbtiles/?tileset=test.mbtiles&z={z}&x={x}&y={y}
or if XYZ schema is used: http://localhost:PORT/mbtiles/?tileset=test.mbtiles&z={z}&x={x}&y=-{y}
Redirect to a Tile Server with QuadKey Tile schema
Redirect can be accessed on address: http://localhost:PORT/redirect/?url=&quadkey=true&z=&x=&y=
– where PORT is set in application settings. In settings, you must specify a directory, where the files are stored. This directory is used as a root for the server. All files in that directory (including subdirectories) will be accessible from the server.
There are several parameters, which must be provided:
- ’url’: url address on which to redirect
- ’quadkey’: ’true’ if the server uses QuadKey Tile schema
- ’z’: map zoom level
- ’x’: x coordinate of a map tile
- ’y’: y coordinate of a map tile
Example: If you want to use for example Bing Maps, which uses QuadKey Tile schema and you only have XYZ tile coordinates you can use the redirect option, which will calculate the quadkey value and then will redirect the request to the server. For accessing Bing Maps Aerial map tiles you can navigate to: http://localhost:PORT/redirect/?url=http://ecn.t0.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=6201&quadkey=true&z={z}&x={x}&y={y}