Open infoWindow of specific marker from outside Google Maps (V3)

前端 未结 2 980
半阙折子戏
半阙折子戏 2020-12-30 07:55

I can\'t seem to get my head around this problem:

I\'ve got a map with (a lot of) markers (companies) that come from a generated XML file. Below the map, I want to s

2条回答
  •  余生分开走
    2020-12-30 08:13

    since i cannot remove this answer, I decided to add some notes!

    if your xml format is similar to this: http://www.w3schools.com/dom/books.xml

    you may access author nodeValue with following lines.

    markers = xml.documentElement.getElementsByTagName("book");
    
    for (var i = 0; i < markers.length; i++) {
      authors = markers[i].getElementsByTagName('author')[0].innerHTML;
    }
    

    hope it helps someone :)

提交回复
热议问题