Altman Family Chiropractic
Linwood Commons
2106 New Rd Suite D2
Linwood, NJ 08221
Phone: (609) 927-7922
Fax: (609) 927-2039
jQuery(function() { function map_initialize() { var directionsService = new google.maps.DirectionsService(); var directionsDisplay = new google.maps.DirectionsRenderer(); var latlng = new google.maps.LatLng(39.3347485, -74.5867034); var myOptions = { zoom: 13, center: latlng, navigationControl: true, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.TOP_LEFT }, scaleControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map( document.getElementById("map"), myOptions ); // setup the map display panel and the directiosn display panel directionsDisplay.setMap(map); directionsDisplay.setPanel(document.getElementById('directions')); // generates the page marker var marker = new google.maps.Marker({ position: latlng, map: map, title: '' }); var ballon = new google.maps.InfoWindow({ content: '' + 'Altman Family Chiropractic' }); // generate the 'ballon' text and display it over the clients location google.maps.event.addListener(marker, 'click', function() { ballon.open(map,marker); }); // start and stop locations for route var waypoints = []; // get and poopulate the waypoints from the user form submission function getWaypoints() { waypoints[0] = document.getElementById('directions_from').value; // the clients location waypoints[1] = document.getElementById('directions_to').value; // where you are going to } /** * callback function to handle the display of the routes directions * @param e Event * @param config array */ function getDirections(e, config) { // clear marker marker.setMap(null); // close the info balloon is directions are requested ballon.close(); // initialize the waypoint values if this is the first time the directions are requested // or a new address was provided in the 'From' field if (!waypoints.length || config.clear) { getWaypoints(); } // reverse the results if the option to do so is selected if (config.reverse) { waypoints.reverse(); } // make sure the user has supplied both locations for the route before processing if (!waypoints[0] || !waypoints[1]) { alert('Please insure that both the \'To\' and \'From\' fields are populated'); return; } // callback function for the 'route' request var directionsRequest = { origin: waypoints[0], // required destination: waypoints[1], // required travelMode: google.maps.DirectionsTravelMode.DRIVING, // required avoidHighways: false, // optional avoidTolls: true // optional }; // request the route's directions directionsService.route(directionsRequest, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); YAHOO.util.Dom.setStyle(YAHOO.util.Dom.get('bottom_controls'), 'display', 'block'); } }); } // attach google events google.maps.event.addListener(marker, 'click', function() { ballon.open(map, marker); }); // attach custom events YAHOO.util.Event.addListener('directions_getmap', 'click', getDirections, { clear: true, reverse: false }); YAHOO.util.Event.addListener('directions_reversemap', 'click', getDirections, { clear: false, reverse: true }); } // as soon as the DOM is ready, make the request to draw the google map YAHOO.util.Event.onDOMReady(map_initialize); });
' + '2106 New Rd Suite D2
' + 'Linwood, NJ 08221
' + '(609) 927-7922' + '