views:

15

answers:

1

Hi

I would open a GMarker (the openInfoWindowHtml) on Google Maps with JavaScript. How can I do that?

Thank you very much

Code of the Marker:

function createMarker(point, id, name, address, type, city, image) {
  var marker = new GMarker(point, customIcons[type]);
  var html = "Information";
  GEvent.addListener(marker, 'click', function() {
    marker.openInfoWindowHtml(html);
  });
  return marker;
+1  A: 

the 1-2-3 steps are like this:

var map = new google.maps.Map(<object to make a map of>)
var marker = new google.maps.Marker({map: map, title: 'title'});
var iwindow = new google.maps.InfoWindow({content: '<blah>html</blah>'});
iwindow.open(map,marker);

just bind the events to it where you want it. this however is the new version of the google api while you are using the old one (which is still supported)

DoXicK