Only add location control in secure context (#60)

This commit is contained in:
Norbert Renner 2018-08-31 14:24:43 +02:00
parent 82632ae69f
commit da1808bb32

View file

@ -128,10 +128,13 @@ BR.Map = {
layersControl = BR.layersTab(baseLayers, overlays).addTo(map);
L.control.locate({
icon: 'fa fa-location-arrow',
iconLoading: 'fa fa-spinner fa-pulse',
}).addTo(map);
var secureContext = 'isSecureContext' in window ? isSecureContext : location.protocol === 'https:';
if (secureContext) {
L.control.locate({
icon: 'fa fa-location-arrow',
iconLoading: 'fa fa-spinner fa-pulse',
}).addTo(map);
}
L.control.scale().addTo(map);