From 1ee82f95639bc57a18964c25ab77ed4e9782e786 Mon Sep 17 00:00:00 2001 From: Charrier Date: Tue, 12 Dec 2023 12:47:02 +0100 Subject: [PATCH] fi: replace process.env by hosname --- static/scripts/buildmap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/scripts/buildmap.js b/static/scripts/buildmap.js index 57167c5ba..7f232b381 100644 --- a/static/scripts/buildmap.js +++ b/static/scripts/buildmap.js @@ -1,7 +1,7 @@ var map = new maplibregl.Map({ container: 'mapcontainer', // container id - style: process.env.HOSTNAME +'/static/json/osm.style.json', + style: 'https://api.' + location.hostname + '/static/json/osm.style.json', // style: 'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL', //style, //https://etalab-tiles.fr/styles/osm-bright/style.json?vector', // style URL // center: [2.087, 46], zoom: 0, @@ -16,7 +16,7 @@ function capitalizeWord(str) { // var DEPARTEMENTS_GEOJSON = "https://gist.githubusercontent.com/maximepvrt/26dd5ed5f26a63bc3040cb3f67594325/raw/c6af19f94f2743b9a445a5a2e6d657a4c0bfc3d6/departements-avec-outre-mer.geojson" // var DEPARTEMENTS_GEOJSON = 'https://raw.githubusercontent.com/etalab/barometre-resultats/master/frontend/static/datasets/geodata/departements-1000m.geojson' -var DEPARTEMENTS_GEOJSON = process.env.HOSTNAME + '/static/json/departements-1000m.geojson' +var DEPARTEMENTS_GEOJSON = 'https://api.' + location.hostname + '/static/json/departements-1000m.geojson' var groupBy = function(xs, key) { return xs.reduce(function(rv, x) { (rv[x[key]] = rv[x[key]] || []).push(x);