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);
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue