don't show the geolocator if we don't have permission
This commit is contained in:
parent
2768af1aeb
commit
7b9ce595d2
11
index.html
11
index.html
@ -169,7 +169,9 @@
|
||||
}
|
||||
})
|
||||
map.addControl(new mapboxgl.NavigationControl(), 'top-left');
|
||||
map.addControl(geolocate, 'top-right');
|
||||
if(navigator.geolocation) {
|
||||
map.addControl(geolocate, 'top-right');
|
||||
}
|
||||
});
|
||||
|
||||
map.on('click', function (e) {
|
||||
@ -200,13 +202,6 @@
|
||||
.addTo(map);
|
||||
});
|
||||
|
||||
geolocate.on('error', function (e) {
|
||||
map.setZoom(10);
|
||||
popup.setLngLat([-73.8966279, 40.7420127])
|
||||
.setHTML(e.message)
|
||||
.addTo(map);
|
||||
});
|
||||
|
||||
var template = $('#Table').html();
|
||||
var rendered = Mustache.render(template, {rows: data});
|
||||
$('#Stores').html(rendered);
|
||||
|
Loading…
Reference in New Issue
Block a user