dist/assets/js/plugins/storeLocator/jquery.storelocator.js
function(origin, locID, map) {
			this.writeDebug('directionsRequest',arguments);

			// Directions request callback
			if (this.settings.callbackDirectionsRequest) {
				this.settings.callbackDirectionsRequest.call(this, origin, locID, map, locationset[locID]);
			}

			var destination = this.getAddressByMarker(locID);

			if (destination) {
				// Hide the location list
				$('.' + this.settings.locationList + ' ul').hide();
				// Remove the markers
				this.clearMarkers();

				// Clear the previous directions request
				if (directionsDisplay !== null && typeof directionsDisplay !== 'undefined') {
					directionsDisplay.setMap(null);
					directionsDisplay = null;
				}

				directionsDisplay = new google.maps.DirectionsRenderer();
				directionsService = new google.maps.DirectionsService();

				// Directions request
				directionsDisplay.setMap(map);
				directionsDisplay.setPanel($('.bh-sl-directions-panel').get(0));

				var request = {
					origin: origin,
					destination: destination,
					travelMode: google.maps.TravelMode.DRIVING
				};
				directionsService.route(request, function(response, status) {
					if (status === google.maps.DirectionsStatus.OK) {
						directionsDisplay.setDirections(response);
					}
				});

				$('.' + this.settings.locationList).prepend('<div class="bh-sl-close-directions-container"><div class="' + this.settings.closeIcon + '"></div></div>');
			}

			$(document).off('click', '.' + this.settings.locationList + ' li .loc-directions a');
		}
function(origin, locID, map) {
			this.writeDebug('directionsRequest',arguments);

			// Directions request callback
			if (this.settings.callbackDirectionsRequest) {
				this.settings.callbackDirectionsRequest.call(this, origin, locID, map, locationset[locID]);
			}

			var destination = this.getAddressByMarker(locID);

			if (destination) {
				// Hide the location list
				$('.' + this.settings.locationList + ' ul').hide();
				// Remove the markers
				this.clearMarkers();

				// Clear the previous directions request
				if (directionsDisplay !== null && typeof directionsDisplay !== 'undefined') {
					directionsDisplay.setMap(null);
					directionsDisplay = null;
				}

				directionsDisplay = new google.maps.DirectionsRenderer();
				directionsService = new google.maps.DirectionsService();

				// Directions request
				directionsDisplay.setMap(map);
				directionsDisplay.setPanel($('.bh-sl-directions-panel').get(0));

				var request = {
					origin: origin,
					destination: destination,
					travelMode: google.maps.TravelMode.DRIVING
				};
				directionsService.route(request, function(response, status) {
					if (status === google.maps.DirectionsStatus.OK) {
						directionsDisplay.setDirections(response);
					}
				});

				$('.' + this.settings.locationList).prepend('<div class="bh-sl-close-directions-container"><div class="' + this.settings.closeIcon + '"></div></div>');
			}

			$(document).off('click', '.' + this.settings.locationList + ' li .loc-directions a');
		}
function ( origin , locID , map ) { this . writeDebug ( 'directionsRequest' , arguments ) ; // Directions request callback if ( this . settings . callbackDirectionsRequest ) { this . settings . callbackDirectionsRequest . call ( this , origin , locID , map , locationset [ locID ] ) ; } var destination = this . getAddressByMarker ( locID ) ; if ( destination ) { // Hide the location list $ ( '.' + this . settings . locationList + ' ul' ) . hide ( ) ; // Remove the markers this . clearMarkers ( ) ; // Clear the previous directions request if ( directionsDisplay !== null && typeof directionsDisplay !== 'undefined' ) { directionsDisplay . setMap ( null ) ; directionsDisplay = null ; } directionsDisplay = new google . maps . DirectionsRenderer ( ) ; directionsService = new google . maps . DirectionsService ( ) ; // Directions request directionsDisplay . setMap ( map ) ; directionsDisplay . setPanel ( $ ( '.bh-sl-directions-panel' ) . get ( 0 ) ) ; var request = { origin : origin , destination : destination , travelMode : google . maps . TravelMode . DRIVING } ; directionsService . route ( request , function ( response , status ) { if ( status === google . maps . DirectionsStatus . OK ) { directionsDisplay . setDirections ( response ) ; } } ) ; $ ( '.' + this . settings . locationList ) . prepend ( '<div class="bh-sl-close-directions-container"><div class="' + this . settings . closeIcon + '"></div></div>' ) ; } $ ( document ) . off ( 'click' , '.' + this . settings . locationList + ' li .loc-directions a' ) ; }
Handle inline direction requests

@param origin {string} origin address
@param locID {number} location ID
@param map {Object} Google Map
Handle inline direction requests