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