2016-08-08 6 views
2

clustergroup과 잘 작동하는 리플렛 맵이 있습니다. clustergroup click에서 팝업을 열려고합니다. 끝 마커 (요소) onclick 팝업 괜찮아요 worning입니다.전단지 클러스터 그룹에 팝업을 표시하는 방법

clustergroup 클릭 이벤트도 캡처 할 수 있지만 팝업을 열 수는 없습니다.

//To create cluster 
      this.markers = L.markerClusterGroup(); 

      //On cluster click get all children 
      this.markers.on('clusterclick', function (a) { 
      this.getClusterData(a.layer.getAllChildMarkers()); 
      //All children is available of cluster when clicked 
     },this); 

팝업을 열 수 없습니다.

+0

가능한 복제 (http://stackoverflow.com/questions/32067832/popup-on-hovering-over-cluster-group) – saluce

답변

0

나는 해결책을 찾았습니다 here. 다른 사람들에게 도움이 될 수 있습니다. 나는 하루 종일 낭비

cluster.on('clustermouseover', function(c) { 
      var popup = L.popup() 
       .setLatLng(c.layer.getLatLng()) 
       .setContent(c.layer._childCount +' Locations(click to Zoom)') 
       .openOn(map); 
      }).on('clustermouseout',function(c){ 
       map.closePopup(); 
      }).on('clusterclick',function(c){ 
       map.closePopup(); 
      }); 
[클러스터 그룹 유혹에 팝업]의
관련 문제