I didn't provide a link because I'm working locally. I've provided
the code below....
function load() {
// Check to see if this browser can run the Google API
if (GBrowserIsCompatible()) {
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/
mm_20_blue.png";
icon.shadow = "http://labs.google.com/ridefinder/images/
mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
var gmarkers = [];
var htmls = [];
var to_htmls = [];
var from_htmls = [];
var i=0;
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);
// The info window version with the "to here" form open
to_htmls[i] = html + '<br>Directions: <b>To here<\/b> - <a
href="javascript:fromhere(' + i + ')">From here<\/a>' +
'<br>Start address:<form action="http://maps.google.com/
maps" method="get" target="_blank">' +
'<input type="text" SIZE=40 MAXLENGTH=40 name="saddr"
id="saddr" value="" /><br>' +
'<INPUT value="Get Directions" TYPE="SUBMIT">' +
'<input type="hidden" name="daddr" value="' + point.lat() +
',' + point.lng() +
// "(" + name + ")" +
'"/>';
// The info window version with the "to here" form open
from_htmls[i] = html + '<br>Directions: <a
href="javascript:tohere(' + i + ')">To here<\/a> - <b>From here<\/b>'
+
'<br>End address:<form action="http://maps.google.com/maps"
method="get"" target="_blank">' +
'<input type="text" SIZE=40 MAXLENGTH=40 name="daddr"
id="daddr" value="" /><br>' +
'<INPUT value="Get Directions" TYPE="SUBMIT">' +
'<input type="hidden" name="saddr" value="' + point.lat() +
',' + point.lng() +
// "(" + name + ")" +
'"/>';
// The inactive version of the direction info
html = html + '<br>Directions: <a href="javascript:tohere('+i
+')">To here<\/a> - <a href="javascript:fromhere('+i+')">From here<\/
a>';
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
}
// functions that open the directions forms
function tohere(i) {
gmarkers[i].openInfoWindowHtml(to_htmls[i]);
}
function fromhere(i) {
gmarkers[i].openInfoWindowHtml(from_htmls[i]);
}
// Display the map, with some controls and set the initial
location
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(42.7818,-73.8569), 10);
// Set up three markers with info windows
function createTabbedMarker(point,icon, html1 ,label1 ) {
var marker = new GMarker(point,icon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowTabsHtml([
new GInfoWindowTab(label1,html1)
]);
});
return marker;
}
//Set up markers with info windows
var point = new GLatLng(42.8072000000,-73.91611314190);
var marker = createTabbedMarker(point,icon, '<b>Organization: </
b>Schenectady Inner City Ministry<br><B>Address: </B>Lafayette &
Chapel Schenectady, NY <br><b>Donation Type</b>: Food',"Callout");
map.addOverlay(marker);
}
// display a warning if the browser was not compatible
else {
alert("Sorry, the Google Maps API is not compatible with this
browser");
}
// This Javascript is based on code provided by the
// Blackpool Community Church Javascript Team
// http://www.commchurch.freeserve.co.uk/
// http://econym.googlepages.com/index.htm
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<table border="0" cellspacing="4" cellpadding="2">
<tr><td width="608"> <div align="center"><font face ="arial" ><img
src="images/title.png" width="241" height="45" /></font>
</div>
<td width="169"><div align="center"><font color="999999"
face="Arial, Helvetica, sans-serif"><a href="about.htm" target="popup"
onClick="wopen('about.htm', 'popup', 480, 400); return false;"><a
href="contact.htm" target="popup"
onclick="wopen('contact.htm', 'popup', 480, 400); return
false;">Contact Us</a> </font> </div>
<td width="94"><div align="center"><font color="999999"
face="Arial, Helvetica, sans-serif"><a href="about.htm" target="popup"
onclick="wopen('about.htm', 'popup', 480, 400); return false;">About</
a></font> </div>
<TR>
<td rowspan="2" bgcolor="#999999">
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td width="600" rowspan="2"><div id="map" style="width: 600px; height:
500px"></div> </tr></table></td>
<td colspan="2"><div align="right"><a href="http://
www.fountainsspatial.com/"> <img src = "images/Sidebar2008_work.png"
align="absmiddle" border="0"/></a>
</div>
</tr>
</table>
<script>
<!--
function wopen(url, name, w, h)
{
w += 32;
h += 96;
var win = window.open(url,
name,
'width=' + w + ', height=' + h + ', ' +
'location=no, menubar=no, ' +
'status=no, toolbar=no, scrollbars=no, resizable=no');
win.resizeTo(w, h);
win.focus();
}
// -->
</script>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---