From c96ee633581deecd17f18eb02250e3cb9aa26abf Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 22 Aug 2018 16:27:54 -0400 Subject: [PATCH] Update again Try this for init map --- glm-member-db/views/front/members/detail.html | 84 +------------------ 1 file changed, 3 insertions(+), 81 deletions(-) diff --git a/glm-member-db/views/front/members/detail.html b/glm-member-db/views/front/members/detail.html index 4487dcb..af3fc82 100644 --- a/glm-member-db/views/front/members/detail.html +++ b/glm-member-db/views/front/members/detail.html @@ -649,87 +649,9 @@ {/if} {*detail_show_map*} -// Direction code is below, but since we're sending them offsite to google maps this is no longer necessary. -// -// {if $settings.detail_show_directions} -// -// var directionsDisplay; -// var directionsService = new google.maps.DirectionsService(); -// -// // Display map with route from specified location to member location -// function calcRoute() { -// -// // If an address was input, use that, otherwise use detected location if available -// var start = $('#glm-startLocation').val(); -// if (start == '' ) { -// if (myLocation != false) { -// start = myLocation; -// } -// } -// -// // If no start location available, tell user -// if (start == '') { -// alert('No starting location. Please enter address.'); -// return; -// } -// -// // Switch to directions map being visible -// $('#glm-directionsMap-container').removeClass('glm-hidden'); -// $('#glm-locationMap-container').addClass('glm-hidden'); -// $('#glm-showLocationButton').removeClass('glm-hidden'); -// -// // Initialize the directions map with a default center location -// directionsDisplay = new google.maps.DirectionsRenderer(); -// var mapOptions = { -// zoom:7, -// center: memberlocation -// } -// directionsMap = new google.maps.Map(document.getElementById("glm-directionsMap"), mapOptions); -// directionsDisplay.setMap(directionsMap); -// -// // Get directions type selected -// var directionsType = $('#directionsType').find(':selected').val(); -// -// // Specify origin and destination then get route -// var request = { -// origin: start, -// destination: memberlocation, -// travelMode: google.maps.TravelMode[directionsType] -// }; -// directionsService.route(request, function(result, status) { -// if (status == google.maps.DirectionsStatus.OK) { -// directionsDisplay.setDirections(result); -// $('#directions-panel').html(''); -// directionsDisplay.setPanel(document.getElementById('directions-panel')); -// } -// }); -// -// // Check for first map idle (completely loaded) - Check max initial zoom -// var mapLoadedListener = google.maps.event.addListener(directionsMap, 'idle', function() { -// if (directionsMap.getZoom() > 16) { -// this.setZoom(16); -// } -// google.maps.event.removeListener(mapLoadedListener); -// }); -// -// } -// -// // Trigger route map either by button or input of address -// $('#glm-showDirectionsButton' ).click( function() { -// calcRoute(); -// }); -// $('#glm-startLocation' ).change( function() { -// calcRoute(); -// }); -// -// // Switch back to member location map -// $('#glm-showLocationButton').click( function() { -// $('#glm-directionsMap-container').addClass('glm-hidden'); -// $('#glm-locationMap-container').removeClass('glm-hidden'); -// $('#glm-showLocationButton').addClass('glm-hidden'); -// }); -// -// {/if} {*detail_show_directions*} + $(window).load(function(){ + initMap(); + }); }); // jquery -- 2.17.1