Google Maps API v3 adding multiple markers w/ info windows w/ custom text

后端 未结 3 942
既然无缘
既然无缘 2020-12-20 21:25

I am making a website over cyclists killed in Norway. For my project I have been using google maps api v3, but I have vague familiarity with javascript. You can see my resul

3条回答
  •  心在旅途
    2020-12-20 21:50

    In addition to HoangHieu Answer when you use for loop it better to use it this way:

    marker.info = new google.maps.InfoWindow({
      content: 'some text'
    });
    
    google.maps.event.addListener(marker, 'click', function() {
      this.info.open(map, this);
    });
    

提交回复
热议问题