Merge pull request #3915 from betagouv/disable-map-tiles-during-tests
carte: disable tiles layer during tests
This commit is contained in:
commit
d8ba8d72e0
1 changed files with 7 additions and 4 deletions
|
@ -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:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
const loadTilesLayer = process.env.RAILS_ENV != 'test';
|
||||
if (loadTilesLayer) {
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
if (editable) {
|
||||
const freeDraw = new FreeDraw({
|
||||
|
|
Loading…
Reference in a new issue