> var geocoder = new daum.maps.services.Geocoder();
> var listData = [
> ' 서울시 강남구 논현동 209-4 ',
> ' 서울시 강남구 논현동 208 ',
> ' 서울시 강남구 논현동 211-14 ',
> ' 서울시 강남구 논현동 210-1 ',
> ' 서울시 강남구 논현동 238 ',
> ' 서울시 강남구 논현동 115-13 ',
> ' 서울시 강남구 논현동 115-11 ',
> ' 서울시 강남구 논현동 115-2 ',
> ' 서울시 강남구 논현동 90-2 ',
> ' 서울시 강남구 논현동 84 ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ];
> var listData1 = [
> ' 유빔빌딩 ',
> ' 오창빌딩 ',
> ' 싸이칸홀딩스타워 ',
> ' 삼원빌딩 ',
> ' 쿠쿠빌딩 ',
> ' 라이브플렉스타워 ',
> ' 시그너스빌딩 ',
> ' IB타워 ',
> ' 프뢰벨교육센터 ',
> ' 송암빌딩 ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ' ',
> ];
> var listData2 = [
> ' 1) ',
> ' 2) ',
> ' 3) ',
> ' 4) ',
> ' 5) ',
> ' 6) ',
> ' 7) ',
> ' 8) ',
> ' 9) ',
> ' 10) ',
> ' 11) ',
> ' 12) ',
> ' 13) ',
> ' 14) ',
> ' 15) ',
> ' 16) ',
> ' 17) ',
> ' 18) ',
> ' 19) ',
> ' 20) ',
> ];
> //for (var i = 0, len = listData.length; i < len; i++) {
> listData.forEach(function(addr, index) {
> geocoder.addressSearch(addr, function(result, status) {
> if (status === daum.maps.services.Status.OK) {
> var coords = new daum.maps.LatLng(result[0].y, result[0].x);
> var marker = new daum.maps.Marker({map: map,position: coords});
> var customoverlay = new daum.maps.CustomOverlay({
> content: '<div class ="label"></span><span class="number">' + listData2[index] + '</span> <span class="boxtitle">' + listData1[index] +' </div>',
> position: coords,
> xAnchor: 0.5,
> yAnchor: 2.7
> });
> customoverlay.setMap(map);
> map.setCenter(coords);
> }});
> });
>
> </script>
> <style type="text/css">
> .label {border-radius: 8px;border: 1px solid #7d7e7e; position:relative;margin-bottom:-1px;background:#fffbfb;padding:6px 10px;line-height: 0.5;}
> .label .boxtitle {color:#0b0dfb;font-size:14px;font-weight:bold;background: url('http://t1.daumcdn.net/localimg/localimages/07/mapapidoc/arrow_white.png') no-repeat right 120px center;margin-bottom:5px;}
> .label .number {color:#f70713;font-size:18px;font-weight:bold;}
> .label :after {content:'';position: absolute; margin-left: -11px; left: 50%; bottom: -11px; width: 22px; height: 12px; background:url('http://t1.daumcdn.net/localimg/localimages/07/mapapidoc/vertex_white.png') }
> </style>
여기서 마커도 제거해서 결과물도 보고 하던중 커스텀오버레이가 겹치는 부분 때문에 오버레이를 드래그해서 위치를 개별적으로약간씩 이동시키면 더 보기에 좋은 결과물이 될것 같아 장시간 드래그하기 예제 코드와 for 반복문을 나름 이용하여 많은 시도를 해봤지만 구현이 안되네요. 방법을 좀 알려주시면 감사하겠습니다.
그리고 드래그하기 예제에서 좌표만 틀리게하고 코드를 똑같이 2개를 만들어서 해본 결과 두번째 오버레이는 드래그가 되는데 첫번째는 오버레이는 첫번째가 움직이지 않고 두번째가 움직이네요.