From 844b32345773fb3460b253a13f29314ca9ac0920 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 12 Dec 2017 09:05:16 -0500 Subject: [PATCH] adding driving directions to the registration page adding the code for the directions button next to the view map button on the registrations page --- views/front/registrations/registration.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index e3a1b5b..e98b477 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -37,6 +37,7 @@
{if $regEvent.locations.lat && $regEvent.locations.lon} +
(map loads here)
@@ -44,7 +45,12 @@
View Map
-
Get Directions
+
+ + + + +
{/if} {literal} @@ -383,5 +389,13 @@ jQuery(function($){ } google.maps.event.addDomListener(window, 'load', initMap); + jQuery("#MemberDrivingDirectionsForm").submit(function(){ + var place = jQuery("#MemberLocation").val().replace( new RegExp( " ", "g" ), '+' ); + var lat = jQuery("#MemberLat").val(); + var lon = jQuery("#MemberLon").val(); + var url = "https://maps.google.com/maps?daddr=" + place + "%40" + lat + "," + lon; + window.open(url, '_blank'); + return false; + }); }); -- 2.17.1