var markers = []; var to_htmls = []; var from_htmls = []; var i = 0; function createMarker(lat, lon, infoMessage, locationName) { var marker = new GMarker(new GLatLng(lat, lon)); var direction_html = '
Get directions: To here - From here
'; var pre_message = "
"; var post_message = "
"; var full_message = pre_message + infoMessage + direction_html + post_message; // The info window version with the "to here" form open to_htmls[i] = pre_message + infoMessage + '
Get directions: To here - From here' + '
Start address:
' + '' + ' ' + '' + '' + post_message; // The info window version with the "from here" form open from_htmls[i] = pre_message + infoMessage + '
Get directions: To here - From here' + '
End address:' + '' + ' ' + '' + '
' + post_message; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(full_message); }); i++; return marker; } // functions that open the directions forms function tohere(i) { markers[i].openInfoWindowHtml(to_htmls[i]); } function fromhere(i) { markers[i].openInfoWindowHtml(from_htmls[i]); } function PSMapInit(m) { m.addControl(new GSmallMapControl()); m.addControl(new GMapTypeControl()); var mgr = new GMarkerManager(m); markers.push(createMarker(37.982634, -122.529831, "Shintaido Open-hand
Sundays, 8:00AM
details...
", "Old Gym at Marin Academy")); markers.push(createMarker(37.747280, -122.411490, "Shintaido Bojutsu and Bokuto
Tuesdays, 8:00 AM
details...
", "Precita Park, Precita Ave & Harrison Street")); markers.push(createMarker(37.734902, -122.439900, "Shintaido Bojutsu
Wednesdays, 10:00AM
details...
", "Glen Park Field on the corner of Elk and Bosworth")); markers.push(createMarker(0.000000, 0.000000, "Shintaido Bojutsu
Wednesdays, 9:00AM
details...
", "Lake Temescal North Entrance 6500 Broadway Avenue Oakland, CA")); markers.push(createMarker(37.848156, -122.233643, "Shintaido Karate
Saturdays, 8:00AM
details...
", "Lake Temescal Park")); mgr.addMarkers(markers, 3); mgr.refresh(); }