CHAPTER 06
Create & Host Map Tiles
If you tile your own map data (GeoTIFF, GeoJSON, etc.) and host it, you can load it in EcorisMap via “Add” on the Map selection screen. This chapter covers how to create and host the three formats EcorisMap supports.
| Format | Source data | Best for |
|---|---|---|
| XYZ raster tiles | Imagery such as GeoTIFF | Aerial photos, scanned maps, analysis results |
| Raster PMTiles | Same as above | The same content delivered/shared as a single file |
| Vector tiles (PMTiles) | Vector data such as GeoJSON | Displaying large polygon/line datasets (vegetation maps, parcels) efficiently |
Creating XYZ raster tiles
Prepare a georeferenced image (such as GeoTIFF). Coordinate systems are converted automatically, but using Web Mercator (EPSG:3857) is the safest choice.
Option 1: QGIS (easy, GUI)
- Load your source data (GeoTIFF, etc.) into QGIS and style it as desired.
- In the Processing Toolbox, run “Raster tools > Generate XYZ tiles (Directory)”.
- Specify the extent, min/max zoom levels (e.g. 8–16), and the output folder. A
{z}/{x}/{y}.pngfolder structure is generated.
Option 2: gdal2tiles (command line)
gdal2tiles.py --xyz -z 8-16 input.tif tiles/
- Always pass
--xyz. Without it, tiles are generated in TMS format and you would need to check “Y-axis inversion” in EcorisMap. -zspecifies the zoom level range.
Option 3: Bundle as raster PMTiles (single-file delivery)
Create an MBTiles with GDAL, then convert it to PMTiles with go-pmtiles.
gdal_translate -of MBTILES input.tif output.mbtiles
gdaladdo -r average output.mbtiles 2 4 8 16
pmtiles convert output.mbtiles output.pmtiles
gdaladdois required to generate the lower-zoom (wide-area) tiles.
Tip: Each additional zoom level roughly quadruples the number of tiles. Raster tiles grow especially fast, so limit the extent and zoom range to what you need. Use roughly 12–14 for wide areas, and 16–18 only where detail is required.
You do not need to generate tiles up to high zoom levels. Set “Fixed zoom” in EcorisMap to the maximum zoom level you generated, and the map keeps displaying with enlarged tiles when zoomed in further. This is an effective way to keep the size down. See Set Up Maps for the setting.
Creating vector tiles
The easiest way to convert vector data such as GeoJSON into vector-tile PMTiles is tippecanoe.
tippecanoe -o vegetation.pmtiles -pf -pk -Z 5 -z 20 -l vegetation input.geojson
-o output.pmtiles— Outputs PMTiles directly.-pf -pk— Disables dropping features due to the per-tile feature-count and size limits, keeping all your data as-is.-Z 5 -z 20— Minimum / maximum zoom levels. Adjust to the range you want to display.-l layername— The layer name inside the tiles, referenced bysource-layerin your style file.- You can pass multiple GeoJSON files to build multi-layer tiles.
Note: Drag and drop a PMTiles file onto pmtiles.io to check it in your browser. It shows the rendered tiles, zoom range, layer names, and metadata, and works for raster PMTiles too.
Preparing a style file
Vector tiles need a style file (JSON) that defines how they are drawn (colors, line styles, etc.).
- Follow the
layersformat of the MapLibre Style Spec. EcorisMap supports the basic properties only. - Samples are available in style_sample. Set
source-layerto the layer name you specified in tippecanoe. - Host the style file alongside the tiles, or load it from your device with the folder button on the Map edit screen.
Hosting the tiles
Tiles are static files, so any web server or static hosting service can serve them.
XYZ tiles (folder)
- Upload the generated
{z}/{x}/{y}.pngfolder structure as-is. - Register it in EcorisMap as
https://your-server/tiles/{z}/{x}/{y}.png.
PMTiles
- Upload the single file. The host must support Range Requests (partial downloads), which major services such as Amazon S3, Cloudflare R2, and GitHub Pages do.
- Register it in EcorisMap as
https://your-server/vegetation.pmtiles. See Set Up Maps for details.
Hosting options
| Service | Notes |
|---|---|
| GitHub Pages | Free and easy. Roughly 1GB per repository and 100MB per file. Good for small to medium datasets |
| Cloudflare R2 / Amazon S3 | For larger datasets. A standard choice for hosting PMTiles. CORS configurable |
| Your own web server | For internal use. Must support Range Requests and HTTPS |
Things to watch
- Using tiles in the web version requires CORS. Set
Access-Control-Allow-Originon the host. This is not needed if you only use the mobile apps. - HTTPS is recommended.
- If your tiles are based on published data, follow the source’s terms of use and add attribution in EcorisMap’s “Attribution” field.
- Access can be restricted. Using signed URLs, tiles can be served so that only users signed in with an organization account can retrieve them, with nothing for the user to do. This requires setup on the hosting side, so please contact us.
Registering in EcorisMap
Register the tile URL via “Add” on the Map selection screen. See Set Up Maps for the settings such as the vector tile checkbox, style URL, and transparency. Set “Fixed zoom” to the maximum zoom level you generated so the map keeps displaying when zoomed in further.
- To use without hosting: transfer the PMTiles file to your device and load it via “import” on the Map selection screen.
- For testing, check the display on mobile first, then the zoom and pan performance, and finally verify CORS in the web version if needed.