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.743040, -122.415139, "Shintaido Bojutsu for Women
Mondays, 7:30 AM
details...
", "2565 3rd Street #309 (and 22nd St), San Francisco, CA 94107- near downtown and the Mission"));
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(37.758072, -122.428125, "Shintaido Open-hand & Karate
Wednesdays, 6:00PM
details...
", "Dolores Park by playground"));
markers.push(createMarker(37.848193, -122.233753, "Shintaido Bojutsu
Thursdays, 9:30AM
details...
Shintaido Kenjutsu
Saturdays, 7:30AM
details...
", "Lake Temescal Park"));
mgr.addMarkers(markers, 3);
mgr.refresh();
}