From 8d016179d1e1d681fe1af0a2281afcc3bcc9a4cc Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 20 Aug 2019 14:31:43 -0400 Subject: [PATCH] updating the brewery map to use google maps switching the brewery map to use google maps instead of leaflet --- parts/header-meta.php | 2 +- sections/brewery-map.php | 613 +++++++++++++++++++++++++-------------- style.css | 2 +- 3 files changed, 392 insertions(+), 225 deletions(-) diff --git a/parts/header-meta.php b/parts/header-meta.php index 410b873..05f1ed3 100644 --- a/parts/header-meta.php +++ b/parts/header-meta.php @@ -3,7 +3,7 @@ <?php wp_title(); ?> - + diff --git a/sections/brewery-map.php b/sections/brewery-map.php index 93e6d60..1c10fb1 100644 --- a/sections/brewery-map.php +++ b/sections/brewery-map.php @@ -5,233 +5,272 @@
-
- - - - - - - - - - + // 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
`; + + drawLine(last(compare),compare[compare.length - 2]) + } else { + distance = ''; + } + infowindow.setOptions({ + content: info + `${distance}` + }); + infowindow.open(map,this); + }); + }); + } +// + \ No newline at end of file diff --git a/style.css b/style.css index ef719ad..8a142a8 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: Discover Kalamazoo 2018 Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for Discover Kalamazoo -Version: 1.0.31 +Version: 1.0.32 */ -- 2.17.1