Make sure OSM map is not enabled in test environment in case it abuses OSM tile servers

This commit is contained in:
Cillian O'Ruanaidh
2024-05-24 11:24:57 +01:00
parent 850385a8d3
commit 46fdeefa14

View File

@@ -71,6 +71,11 @@ export default class extends Controller {
}
#displayMap() {
// Don't initialise map in test environment because that could possibly abuse OSM tile servers
if(process.env.RAILS_ENV == "test") {
return false;
}
this.map = L.map('open-street-map')
L.tileLayer.provider(this.providerNameValue, this.providerOptionsValue).addTo(this.map)
this.map.setView([this.defaultLatitudeValue, this.defaultLongitudeValue], this.zoomLevel)