diff --git a/app/javascript/shared/carte.js b/app/javascript/shared/carte.js index 2ba1f7445..b6f76a27a 100644 --- a/app/javascript/shared/carte.js +++ b/app/javascript/shared/carte.js @@ -13,10 +13,13 @@ export function initMap(element, position, editable = false) { scrollWheelZoom: false }).setView([position.lat, position.lon], editable ? 18 : position.zoom); - L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: - '© OpenStreetMap contributors' - }).addTo(map); + const loadTilesLayer = process.env.RAILS_ENV != 'test'; + if (loadTilesLayer) { + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: + '© OpenStreetMap contributors' + }).addTo(map); + } if (editable) { const freeDraw = new FreeDraw({