don't show the geolocator if we don't have permission

This commit is contained in:
David 2017-03-26 23:22:10 -04:00
parent 2768af1aeb
commit 7b9ce595d2

View File

@ -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);