On Jul 28, 1:56 pm, Geoff <[email protected]> wrote:
> Thanks Andrew
>
> I have been to Mike's site and added the code to my website page. I
> included the function he used from his example page but no matter
> where I seem to put it the map wouldn't work any longer. The geocode
> is correct for the two markers. I have now left the function in but
> commented it out.
Commenting out a function has no effect if you don't actually call it.
You don't call it! You have
var point = new GPoint(51.33892341204783, -2.310519218444824);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("Galleries Shop");
});
map.addOverlay(marker);
without ever actually creating "marker". Consequently your code fails
because you are telling the API to add a listener to something you
haven't created.
You should be doing something like
var point = new GLatLng(51,-2);
// note the order of Lat and Lng, it's not the same as GPoint
// create a marker at "point" with some infoWindow text
var marker = createMarker(point, "Galleries Shop");
// and add it to the map
map.addOverlay(marker);
Currently you have fallen into Pitfall Number Three in Mike's tutorial
page and even if your markers were created your infoWindows wouldn't
work correctly because of that. And they would be in the wrong place
because you have used GPoint instead of GLatLng.
You also have three <body> tags, which will cause problems because
there is no guarantee which one any particular browser will see as the
"real" one. I'm a little surprised FrontPage allows that to happen,
but then it is by Microsoft...
<html>
<head>
<title>...</title>
</head>
<body>
...
</body>
</html>
By the way, fourteen decimal places goes down to nanometres. Five or
six is plenty.
Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---