에 클릭 이벤트를 주고 싶은데 일반 마커 하나일 때랑 똑같이 클릭 이벤트를 주니까 안 먹히더라고요 혹시 어디 위치에 어떻게 줘야 하는지 알 수 있을까요… 참고할 수 있는 주소도 있으며ㄴ 부탁드리겠습니다…
var data= {
“positions” : [
{
“lat”: 36.33884892276137,
“lng”: 127.393666019664
}
]
}
좌표값 데이터들을 저런식으로 나열했고
var imageSrc2 = ‘/images/main/mark_edu.png’,
imageSize2 = new kakao.maps.Size(35, 45),
imageOption2 = {offset: new kakao.maps.Point(25, 38)}
var markerImage2 = new kakao.maps.MarkerImage(imageSrc2, imageSize2, imageOption2),
markerPosition2 = new kakao.maps.LatLng(position.lat, position.lng);
var marker2 = data.positions.map(function(position) {
return new kakao.maps.Marker({
position : new kakao.maps.LatLng(position.lat, position.lng),
image: markerImage2,
isCustomImageAutoscale: true,
clickable: true
});
});
마커 객체 생성후
var clusterer = new kakao.maps.MarkerClusterer({
map: map,
averageCenter: true,
calculator: [10, 50, 100]
minLevel: 9,
styles: [{
width : '100px', height : '100px',
background: 'rgba(41, 98, 255, 0.9)',
borderRadius: '50%',
color: '#ffffff',
textAlign: 'center',
fontWeight: '400',
lineHeight: '70px'
}
]
});
클러스터러 생성
clusterer.addMarkers(marker2);
클러스터러에 마커들을 넣었습니다
소스는 문제가 없는데 클릭 이벤트가 궁금합니다…