views:

24

answers:

2

Hi, i've started very enthousiastic with google maps and managed to get the info from my mysql dbase to the map on my site. The problem i'm facing now is that i want to be able to click through from the info window to a page on my site (the link also comes out of the dbase).

Here is the standard google api code I'm using now ('mijnlink' is the link), i've tried a lot of different things but so far no solution, hope you can help me to find the answer:

  GDownloadUrl("../phpsqlajax_genxml.php", function(data) {
      var xml = GXml.parse(data);
      var markers = xml.documentElement.getElementsByTagName("marker");
      for (var i = 0; i < markers.length; i++) {
    var mijnlink = markers[i].getAttribute("mijnlink");
        var naam = markers[i].getAttribute("naam");
        var address = markers[i].getAttribute("address");
        var hotelcampingbungalow = markers[i].getAttribute("hotelcampingbungalow");
        var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                parseFloat(markers[i].getAttribute("lng")));
        var marker = createMarker(point, mijnlink, naam, address, hotelcampingbungalow);
        map.addOverlay(marker);
      }
    });
  }
}

function createMarker(point, mijnlink, naam, address, hotelcampingbungalow) {
  var marker = new GMarker(point, customIcons[hotelcampingbungalow]);
  var html = "<b>" + mijnlink + hotelcampingbungalow + "&nbsp;" + naam + "</b> <br/>" + address;
  GEvent.addListener(marker, 'click', function() {
    marker.openInfoWindowHtml(html);
  });
  return marker;

Kind regards, Arjen.

A: 

See this other SO question

Peter Hanneman
A: 

Got some other help, the var html in the Createmarker function must be like this:

var html = "klik hier" + hotelcampingbungalow + " " + naam + "
" + address;