From: Anthony Talarico Date: Wed, 2 May 2018 13:02:26 +0000 (-0400) Subject: adding border around downtown brewery map X-Git-Tag: v1.0.0^2~11 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=4ffda388edba1e963a43ae27e501aa9e9026511b;p=WP-Themes%2Fdiscoverkalamazoo2018.git adding border around downtown brewery map --- diff --git a/sections/brewery-map.php b/sections/brewery-map.php index 54ff27f..a24fd30 100644 --- a/sections/brewery-map.php +++ b/sections/brewery-map.php @@ -15,7 +15,7 @@ function initMap() { // Styles a map in night mode. var url = ''; - console.log(url); + map = new google.maps.Map(document.getElementById('brewery-map'), { center: {lat: 42.2903325, lng: -85.5853277 }, zoom: 14, @@ -229,12 +229,21 @@ } ] }); + var downtown = [ + {lat: 42.295482, lng: -85.578543}, + {lat: 42.294493, lng: -85.590343}, + {lat: 42.288731, lng: -85.597809}, + {lat: 42.288811, lng: -85.579227}, + {lat: 42.295482, lng: -85.578543}, + ]; var poly = new google.maps.Polyline({ + path:downtown, strokeColor: '#91311D', strokeOpacity: 2.0, strokeWeight:2, map:map }); + poly.setMap(map); var distancePath = new google.maps.Polyline(); function drawLine(point1, point2) { @@ -410,31 +419,24 @@ map: map, html: `` }); + // Add a click listener for this marker marker.addListener('click', function(event) { - - compare.push(new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())); if(compare.length >= 2){ // console.log(`${previous}, ${current}`) distance = `
Distance: ${Math.round(convertMetersToFeet(google.maps.geometry.spherical.computeDistanceBetween(last(compare), compare[compare.length - 2] ) ) * 10) / 10} Miles
`; - // console.log(distance) + drawLine(last(compare),compare[compare.length - 2]) } else { distance = ''; } - - // path.push(feature.position); - infowindow.setOptions({ content: info + `${distance}` }); infowindow.open(map,this); - }); - }); - } // \ No newline at end of file