From b40ca276b78b233792328c3ad2309b53470e9eac Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 11 Jul 2017 03:52:29 -0400 Subject: [PATCH] #96 Just needed to set the API key correctly --- static/js/map.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/map.js b/static/js/map.js index c911b6f..87ca15a 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -221,7 +221,7 @@ loadGoogleMapsAPI({ key:mapKey }) // Get street view imagery function getStreetViewData(loc,rad,cb) { - // Ensure that the location hasn't changed + // Ensure that the location hasn't changed (or this is the initial setting) if ( newLoc == null || loc.tim===newLoc.tim ) { if (!sv) { var sv=new googlemaps.StreetViewService(); } sv.getPanorama({ @@ -268,7 +268,8 @@ loadGoogleMapsAPI({ key:mapKey }) // Set image getStreetViewData(loc, 2, function(data){ - $('#panoImg').attr('src','https://maps.googleapis.com/maps/api/streetview?size='+$('#pano').width()+'x'+$('#pano').height()+'&location='+data.location.latLng.lat()+','+data.location.latLng.lng()+'&fov=90&heading='+loc.dir+'&key={{api}}'); + console.log('got data:',data); + $('#panoImg').attr('src','https://maps.googleapis.com/maps/api/streetview?size='+$('#pano').width()+'x'+$('#pano').height()+'&location='+data.location.latLng.lat()+','+data.location.latLng.lng()+'&fov=90&heading='+loc.dir+'&key='+mapKey); }); }