From 7b9ce595d2afd3f13bddcc18cb921f12e1e3b134 Mon Sep 17 00:00:00 2001 From: David Ashby Date: Sun, 26 Mar 2017 23:22:10 -0400 Subject: [PATCH] don't show the geolocator if we don't have permission --- index.html | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 817b8b7..8e7e114 100644 --- a/index.html +++ b/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);