I've clearly made an error here - the icon shows up fine, but the
window no longer pops up. Can anyone provide assistance?
<script type="text/javascript">
function initialize()
{
if (GBrowserIsCompatible())
{
function createMarker(point,html)
{
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function()
{
marker.openInfoWindowHtml(html);
});
return marker;
}
var map = new GMap2(document.getElementById
("map_canvas"));
map.setCenter(new GLatLng(53.958427,-94.513672), 3);
var mapControl = new GMapTypeControl();
map.addControl(mapControl);
map.addControl(new GLargeMapControl());
var icon = new GIcon();
icon.image = "marker.png";
icon.shadow = "shadow-marker.png";
icon.iconSize = new GSize(20.0, 34.0);
icon.shadowSize = new GSize(38.0, 34.0);
icon.iconAnchor = new GPoint(10.0, 17.0);
icon.infoWindowAnchor = new GPoint(10.0, 17.0);
var point = new GLatLng(49.2641260,-123.1682350);
var marker = createMarker(point,'<div>html data here</
div>')
map.addOverlay(new GMarker(point, icon));
}
}
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---