Only add location control in secure context (#60)
This commit is contained in:
parent
82632ae69f
commit
da1808bb32
1 changed files with 7 additions and 4 deletions
11
js/Map.js
11
js/Map.js
|
|
@ -128,10 +128,13 @@ BR.Map = {
|
||||||
|
|
||||||
layersControl = BR.layersTab(baseLayers, overlays).addTo(map);
|
layersControl = BR.layersTab(baseLayers, overlays).addTo(map);
|
||||||
|
|
||||||
L.control.locate({
|
var secureContext = 'isSecureContext' in window ? isSecureContext : location.protocol === 'https:';
|
||||||
icon: 'fa fa-location-arrow',
|
if (secureContext) {
|
||||||
iconLoading: 'fa fa-spinner fa-pulse',
|
L.control.locate({
|
||||||
}).addTo(map);
|
icon: 'fa fa-location-arrow',
|
||||||
|
iconLoading: 'fa fa-spinner fa-pulse',
|
||||||
|
}).addTo(map);
|
||||||
|
}
|
||||||
|
|
||||||
L.control.scale().addTo(map);
|
L.control.scale().addTo(map);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue