diff --git a/martin.Dockerfile b/martin.Dockerfile index dc771c21f..0b8ad2be3 100644 --- a/martin.Dockerfile +++ b/martin.Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/maplibre/martin:1.8.2@sha256:7137cad2facf21ef4af6cbef051ce0553b717e8289fde57b50b50c5ac93275b7 +FROM ghcr.io/maplibre/martin:1.10.1@sha256:808afb520272ebf37ea582b0191bd7a2d87c3cf89a552000883bfbdbced9688c COPY martin /config COPY symbols /symbols diff --git a/martin/configuration.yml b/martin/configuration.yml index 41f70c600..d57a7f753 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -21,6 +21,9 @@ postgres: # # You may set this to `false` to disable. auto_publish: false + # Convert tiles to MapLibre Tiles (MLT) when the client requests such tiles + convert_to_mlt: auto + # No tables, see function sources below tables: {} diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index 6c283e24a..be4f39683 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -570,8 +570,9 @@ const sources = { }, high: { type: 'vector', - url: '/railway_line_high,railway_text_km', + url: '/railway_line_high', promoteId: 'id', + encoding: 'mlt', }, openrailwaymap_standard: { type: 'vector', diff --git a/proxy/js/ui.js b/proxy/js/ui.js index bc7779195..253d5490c 100644 --- a/proxy/js/ui.js +++ b/proxy/js/ui.js @@ -1185,6 +1185,16 @@ const map = new maplibregl.Map({ maxZoom: globalMaxZoom, attributionControl: false, renderWorldCopies: false, + transformRequest: function(url, resourceType) { + if (resourceType === 'Tile' && url && url.startsWith('http://localhost:8000/railway_line_high')) { + return { + url, + headers: { + 'Accept': 'application/vnd.maplibre-tile' + }, + } + } + }, ...(configuration.view || defaultConfiguration.view), });