External map layer
To add an external WMS layer to the tracking map.

sample map with swiss topo layer: https://racemap.com/player/swiss-topo-sample
URL to call external layer: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&LAYERS=ch.swisstopo.swissimage&STYLES=default&CRS=EPSG:3857&BBOX={bbox-epsg-3857}&WIDTH=256&HEIGHT=256&FORMAT=image/png
more about swiss topo. https://www.geo.admin.ch/en/geo-services/geo-services/portrayal-services-web-mapping/web-map-services-wms.html
SERVICE
WMS
REQUEST
GetMap
VERSION
1.3.0 or 1.1.0
STYLES
empty
CRS (1.3.0) or SRS (1.1.0)
EPSG:3857
BBOX
{bbox-epsg-3857} a variable
WIDTH
256; same as tile size respectively
HEIGHT
256; same as tile size respectively
FORMAT
image/png or image/jpeg
TRANSPARENT
true
LAYERS: different, available in GetCapabilities e.g. https://wxs.ign.fr/yourkey/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
Use GeoTIFF
mapbox style editor "Create a style" and "Start from scratch"

Add a "Custom layer" and upload the GeoTIFF or KML file.

mapbox creates the layer ID once the GeofTIFF is uploaded
racemap.48p1az6b
RACEMAP >> Map Settings >> External Layers Add URL as external WMS:
https://api.mapbox.com/v4/racemap.48p1az6b/{z}/{x}/{y}.png?access_token={privateKeyMapbox}and replace{privateKeyMapbox}with your mapbox key.
The result shows the original TIFF file: https://racemap.com/player/6a01a8d5bd1f6d9fc6f4f50d
Remove the border in the GeoTIFF
Free download of QGIS
Load GeoTIFF and create a new GeoPackage-layer

Select "Polygon"

Define borders with the pencil and polygon tool - left click: add point, right click: finish polygon.

Raster >> Extraction >> Clip Raster by Mask Layer: Data outside the polygon is removed.

Select the GeoTIFF as the input file, the mask layer to use (previously created), enable "Create an output alpha band" and "Keep resolution of input raster".

6. QGIS generates a new GeoTIFF file, which you now use to create another mapbox layer.

Sample: https://racemap.com/player/external-layer-mask/
We needed to run "Fix Geometries" in QGIS before extraction processed successfully.
Last updated
