markerclusterer info windows

前端 未结 4 1810
遇见更好的自我
遇见更好的自我 2020-12-15 14:18

Let me say I am still fairly new to google maps and javascript. i\'ve been mixing together the google store locator tutorial with some other stuff. So far, I am using mark

4条回答
  •  Happy的楠姐
    2020-12-15 14:42

    infoWindow.Open has two overloads

     infoWindow.Open(map, marker)
     infoWindow.Open(map)
    

    Since you wanto to add it to a cluster (not a marker) you should use the second one

    You must set the position getting the center of the cluster

    google.maps.event.addListener(markerCluster, "mouseover", function (mCluster) {    
        infowindow.content += "
    Something<\/div>"; infowindow.setPosition(mCluster.getCenter()); infowindow.open(map); });

    I know it works because I just did it

    google maps api v3 + infoBubble in markerClusterer

提交回复
热议问题