Here's the code I'm using - I don't see what's wrong - If I take out the event listener, I can get markers to show up on the screen, but the map doesn't show.
Anyone see something I missed?
Thanks!
Jason
Anyone see something I missed?
Thanks!
Jason
Code:
<head>
...
<script type="text/javascript" src="[URL unfurl="true"]http://www.google.com/jsapi?key=[/URL][..My Google API Key...]"></script>
<script type="text/javascript">
google.load("maps", "2");
</script>
<script type="text/javascript">
function initialize() {
var map = new google.maps.Map2(document.getElementById("map_canvas"));
map.setCenter(new google.maps.LatLng(40, -98, 3);
map.addControl(new google.maps.LargeMapControl());
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
...
<div id="map_canvas" style="width: 650px; height: 500px; margin: 5px auto;"></div>
<script type="text/javascript">
// Create a map object
var map = new google.maps.Map2(document.getElementById("map_canvas"));
var bounds = new google.maps.LatLngBounds();
map.addControl(new google.maps.LargeMapControl());
map.setMapType(G_NORMAL_MAP);
markerHTML = "1792 Filigree Inn Bed & Breakfast "
geopoint = new google.maps.LatLng(42.7569, -77.4043);
marker = new google.maps.Marker(geopoint);
google.maps.Event.addListener(marker, "click",
function() {
marker.openInfoWindowHTML(markerHTML);
}
map.addOverlay(marker);
markerHTML = "Abner Adams House B & B "
geopoint = new google.maps.LatLng(42.8992, -77.4313);
marker = new google.maps.Marker(geopoint);
google.maps.Event.addListener(marker, "click",
function() {
marker.openInfoWindowHTML(markerHTML);
}
map.addOverlay(marker);
...