My newbish script using google maps api works except when you click on
the icon on the map the overlay window is not poping up.

Please help.

Here's the entire script, which is just an html page with the api
script:



<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
    <title>dudlydundat.com</title>
  <script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=InsertYourKeyHere&sensor=false"
            type="text/javascript"></script>
  <script type="text/javascript">

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(38.4075908,-120.7139102), 13);
        map.setUIToDefault();

// Creating a new marker start
var marker = new GMarker(new GLatLng(38.4075908,-120.7139102))
// Adding a click-event to the marker

GEvent.addListener(marker, 'click', function() {
  // When clicked, open an Info Window
marker.openInfoWindowHtml("Hi.");
});  // Create new marker end

                // create the custom icon
var customIcon = new GIcon(G_DEFAULT_ICON);
customIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/
micons/blue-dot.png";
var point = new GLatLng(38.4075908,-120.7139102);
    map.addOverlay(new GMarker(point, customIcon));

//map.addOverlay(marker);
      }
    }
    </script>

</head>

  <body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
<div style="width: 500px; height: 300px"><a href="index.php?
deleteme=65.161.164.133">Delete my post</a> |
<a href="javascript:location.reload(true)">Refresh page</a>
</div>
  <body onunload="GUnload()">
</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
-~----------~----~----~----~------~----~------~--~---

Reply via email to