대법원사건검색 대법원 종합법률정보 인터넷등기소 대법원등기소 대법원판례 법제처 기본증명서 인터넷발급 민원24 수원지방법원 전자소송 대전지방법원 부산지방법원 인천지방법원 대법원전자민원센터 등기부등본열람 서울고등법원 법률구조공단 대법원 판례검색 대한법률구조공단 더보기
(function(){ var NetizenToggle = function(type){ this.type = (type) ? type : ""; this.btnEl = daum.$E("netizen_more_btn_" + type); this.listsWrapper = daum.$E("netizen_lists_" + this.type); this.lists = daum.$$("#netizenColl_" + this.type + " .list_keyword span.wsn"); this.etccode = 1; }; NetizenToggle.prototype = { getType: function(){ var lists = this.lists; var type = ""; var list = this.lists[this.lists.length-1]; var top = daum.Element.getCoordsTarget(list, list.parentNode).top; if(top > 40){ type = "type3"; }else if(top > 25){ type = "type2"; }else{ type = "type1"; } return type; }, checkFirstTime: function(){ this.check(); }, setBtnStatus: function(opt1, opt2){ if(opt1=="more"){ this.btnEl.removeClassName("fold"); this.btnEl.innerHTML = '더보기'; }else if(opt1=="fold"){ this.btnEl.addClassName("fold"); this.btnEl.innerHTML = '접기'; } if(typeof(opt2)!="undefined"){ if(opt2=="hide"){ this.btnEl.addClassName("hide"); }else if(opt2=="show"){ this.btnEl.removeClassName("hide"); } } }, check: function(){ var type = this.getType(); if(this.listsWrapper.hasClassName("type2")){ if(type=="type1"){ this.setBtnStatus("more","hide"); this.listsWrapper.removeClassName("type2"); }else if(type=="type3"){ this.setBtnStatus("more","show"); } }else if(this.listsWrapper.hasClassName("type3")){ if(type=="type1"){ this.setBtnStatus("fold","hide"); this.listsWrapper.removeClassName("type3"); }else if(type=="type2"){ this.setBtnStatus("more","hide"); this.listsWrapper.className = "list_keyword type2"; } }else{ if(type=="type2"){ this.setBtnStatus("more","hide"); this.listsWrapper.className = "list_keyword type2"; }else if(type=="type3"){ if (this.btnEl.hasClassName('fold')) { this.setBtnStatus("fold","show"); this.listsWrapper.className = "list_keyword type3"; } else { this.setBtnStatus("more","show"); this.listsWrapper.className = "list_keyword type2"; } } } }, toggle: function(){ var type = this.getType(); if(type == "type1"){ }else{ if(this.btnEl){ if(this.btnEl.innerHTML == '더보기'){ this.setBtnStatus("fold"); this.listsWrapper.className = "list_keyword type3"; }else{ this.setBtnStatus("more"); this.listsWrapper.className = "list_keyword type2"; } } } }, init: function(){ if(this.btnEl){ daum.Event.addEvent(this.btnEl, "click", daum.Function.bind(function(e){ this.toggle(); }, this)); daum.Event.addEvent(window, "resize", daum.Function.bind(function(e){ this.check(); }, this)); this.checkFirstTime(); } } }; var netizenToggle; netizenToggle = new NetizenToggle("top"); netizenToggle.init(); setTimeout(function() { netizenToggle.checkFirstTime(); },0); })();
대한민국 법원, 법령, 판례, 판결, 입법예고, 경매, 소송절차, 참여재판, 공탁사건 조회.
서울 서초구 서초대로 219
서초구 서초동 967 (지번)02-3480-1100
매각 공고, 부동산, 자동차 경매 물건 검색, 집행기관, 진행 절차, 서식, 입찰 안내.
부동산 법인등기부 등본, 등기부 열람, 신청사건 처리현황, 지역별 등기소, 발급내역 확인 안내.
대법원, 법원심급별 지방법원, 헌법재판소 판례검색 제공.
try{ var _jsSiteList = new _jsCollPaging_v1("site", "siteColl", {code:'AUGH', expCode:"IVR", viewCnt:4, maxViewCnt:18, target:'_blank', params: '&col=site,snspr,cafename,blogname,web&qsearch_ver=v2&viewtype=json'}); } catch(e) { SF.M.jsErrorLog({device : "pc", func : "_jsCollPaging_v1_site", error : e.message }); };
_jsSiteList.extendSiteView = function(numOfdata, maxListCount) { try{ if (!this.isExtendSiteFirst) { this.callLoading(true); daum.Array.each(daum.$$('#siteColl .hide'), function (el, index) { daum.Element.show(el); }); this.isExtendSiteMore = (numOfdata > maxListCount); var wrap = daum.$(this.type + "WrapExtend"); var closeBtn = daum.$(this.type + "MoreFold"); daum.Element.replaceClassName(wrap, "extend_type1", "extend_type2"); daum.Element.show(closeBtn); if (this.isExtendSiteMore) { this.callLoading(false); } else { daum.Element.replaceClassName(daum.$(this.type+"ExtendView"), "open", "close"); daum.Element.replaceClassName(wrap, "extend_type2", "extend_type1"); daum.$(this.type+"ExtendView").innerHTML = "접기"; daum.Element.hide(closeBtn); } this.chkLastPage(true); this.isExtendSiteFirst = true; } else { if (this.isExtendSiteMore) { this.extendView(); } else { daum.Array.each(daum.$$('#siteColl .hide'), function (el, index) { daum.Element.hide(el); }); var wrap = daum.$(this.type + "WrapExtend"); var closeBtn = daum.$(this.type + "MoreFold"); daum.$(this.type+"ExtendView").innerHTML = "펼쳐보기"; daum.Element.replaceClassName(daum.$(this.type+"ExtendView"), "close", "open"); daum.Element.replaceClassName(wrap, "extend_type2", "extend_type1"); daum.Element.hide(closeBtn); this.isExtendSiteFirst = false; } } } catch(e) { this.failure(); SF.M.jsErrorLog({device : "pc", func : "_jsSiteList.extendSiteView", error : e.message }); }; }; _jsSiteList.siteCreate = function (req) { try{ if( !(req && req.responseText) ) { this.failure(); } var data = daum.jsonToObject(req.responseText); if (!data) { this.failure(); return; } var SPREAD_SITE = data.RESULT.SPREAD_SITE; var directory_url = 'http://search.daum.net/search?w=site&m=directory&col=site&q='; var cafe_url = '?w=cafe&m=name&SearchType=tag&ResultType=3&lpp=10&q='; var datums = SPREAD_SITE.data.datum; if (typeof(datums.length) == 'undefined') { var arr = [datums]; datums = arr; } var templateData = {siteData: []}; var logs = null; function attchCafeBadge( cafe_official ){ if (!daum.String.isEmpty(cafe_official)) { if (cafe_official[3] == '1') { txt_type.push('공식팬카페'); } else if (cafe_official == '00000001') { txt_type.push('e전남'); } else if (cafe_official == '00000010') { txt_type.push('육군'); } else if (cafe_official[4] == '1') { txt_type.push('우수카페'); } } } for (var i = 0, datum; datum = datums[i]; i++) { var lang = datum.lang || ''; var official = datum.official || ''; var cafe_official = datum.cafe_official || ''; var title = datum.title || ''; var url = datum.url || ''; var url_link = datum.url_link || ''; var docid = datum.docid || ''; var content = datum.content || ''; var collection = datum.collection || ''; var dttm = datum.dttm || ''; var sourcetype = datum.sourcetype || ''; var local_info = datum.local_info || ''; var new_local_info = datum.new_local_info || ''; var main_phone = ''; var confirmid = ''; var phone_number = ''; var fullname_address = ''; if (!daum.String.isEmpty(local_info)) { infoArr = local_info.split('^'); main_phone = infoArr[2]; confirmid = infoArr[3]; phone_number = infoArr[4]; fullname_address = infoArr[5]; } var new_fullname_address = ''; if (!daum.String.isEmpty(new_local_info)) { new_infoArr = new_local_info.split('^'); new_fullname_address = new_infoArr[5]; } if ((url == '') && (url_link != '')) { url = url_link; } var short_url = url.replace('http://', ''); short_url = daum.String.cutString(short_url, 44, '..'); if (url_link != '') { url = url_link; } url = url.replace('', '').replace('', ''); var tag = ''; var tagid = ''; if (!daum.String.isEmpty(datum.tag)) { tag = datum.tag.split('|')[0]; } if (!daum.String.isEmpty(datum.tagid)) { tagid = datum.tagid.split('|')[0]; } var index = this.log.count++; var logs = SF.printLog({ "s": "TO", "a": this.log.code, "d": docid, "pg": "1", "r": index + 1, "st": "1", "rc": this.maxViewCnt, "bt": (title.toLowerCase().indexOf("") > -1) ? "1" : "0", "hs": (content != "") ? "1" : "0", "hi": "0", "ext": ("cpid="+collection), "dc": "IVR" }); var sqcIdx = (this.page * 4) + i; var txt_type = []; /* ico_type1의 textnode */ var txt_origin = ''; /* ico_type2의 textnode */ var cafe_member = ''; var cafe_dttm = ''; var localUrl = ''; var fullAddress = ''; var phoneNumber = ''; if (collection == 'site') { if (official == 'Y') { txt_type.push('공식'); } if (lang == 'ENG') { txt_type.push('영어'); } else if (lang == 'CHN') { txt_type.push('중국어'); } else if (lang == 'JPN') { txt_type.push('일본어'); } if (!daum.String.isEmpty(confirmid)) { localUrl = 'http://map.daum.net/?q=' + encodeURIComponent(title.replace('', '').replace('', '')) + '&srcid=' + confirmid; if (daum.String.isEmpty(new_fullname_address)) { fullAddress = fullname_address; } else { fullAddress = new_fullname_address + "
" + fullname_address + " (지번)"; } phoneNumber = main_phone || phone_number; } attchCafeBadge( cafe_official ); var cafeOrigin = getCafeOrigin(url, false); txt_origin = daum.String.isEmpty(cafeOrigin) ? getBlogOrigin(url, false) : cafeOrigin; } else if (collection == 'webdoc') { txt_origin = '웹수집'; } else if (collection == 'blogname') { txt_origin = getBlogOrigin(url, true); } else if (collection == 'cafename') { cafe_member = lang; if (dttm.length > 7) { cafe_dttm = dttm; cafe_dttm = cafe_dttm.substring(0, 4) + '.' + cafe_dttm.substring(4, 6) + '.' + cafe_dttm.substring(6, 8); } attchCafeBadge( cafe_official ); txt_origin = getCafeOrigin(url, true); } else if (collection == 'snspr') { var lastIdx = url.lastIndexOf('/'); if (lastIdx != -1) { var urlPrefix = url.substring(0, lastIdx); if (url.indexOf('twitter') != -1) { txt_origin = '트위터'; } else if (url.indexOf('facebook') != -1) { txt_origin = '페이스북'; } else if (url.indexOf('me2day') != -1) { txt_origin = '미투데이'; } else if (url.indexOf('yozm') != -1) { txt_origin = '요즘'; } } } /* 카페는 태그 목록이 따로 존재할 수 있음 */ var cafeTags = []; if (collection == 'cafename') { if (daum.String.trim(tag).length > 0) { var tags = tag.split(' '); if (tags.length > 0) { for (var j = 0, t; t = tags[j]; j++) { cafeTags.push({ paramTag: daum.String.stripTags(t), tag: t }); } } } } /* 추가 정보 */ var etcData = {}; if (collection == 'site') { /* url, 사이트 분류 */ etcData = { directoryUrl: directory_url, shortUrl: short_url, tags: [] }; var tags = tag.split('^'); var tagids = tagid.split(' '); if (tags.length == tagids.length) { /* 태그 정보의 끝에서 세 개만 사용, 인물 > 방송인 > 기상캐스터 > 박은지일 경우 방송인 > 기상캐스터 > 박은지만 노출함 */ var start_idx = Math.max(tags.length - 3, 0); for (var j = start_idx, t; t = tags[j]; j++) { etcData.tags.push({ tagId: tagids[j], tag: t }); } } } else if (collection == 'cafename') { /* 카페 url, 회원수, 개설일 */ etcData = { shortUrl: short_url, cafeMember: this.comma(cafe_member) || '', cafeDttm: cafe_dttm || '' }; } else if (collection == 'blogname') { /* 블로그 url, 별명: 블로거 별명 */ etcData = { shortUrl: short_url, tag: tag || '' }; } else if (collection == 'webdoc') { /* 웹문서 url */ etcData = { shortUrl: short_url }; } else if (collection == 'snspr') { /* sns url, sns 아이디 */ etcData = { shortUrl: short_url, snsLink: '', tag: tagid || '' };; var stripTagId = daum.String.stripTags(tagid); if (!daum.String.isEmpty(stripTagId) && txt_origin != '페이스북') { if (txt_origin == '트위터') { tagid = '@' + tagid; } etcData.paramTag = stripTagId; etcData.tag = tagid; } } templateData.siteData.push({ log: logs, target: this.target, docid: docid, collection: collection, url: url, title: title, confirmId: confirmid, localUrl: localUrl, fullAddress: fullAddress, phoneNumber: phoneNumber, content: content, cafeTags: cafeTags, sqcIdx: sqcIdx, sourceType: sourcetype, etcData: etcData, txt_origin: txt_origin, txt_type: txt_type }); } daum.$$("#"+this.id+" ul:first")[0].innerHTML += SF.M.tmpl('siteCollpagingTemplate', templateData); delete data; buf = null; data = null; } catch (e){ this.failure(); SF.M.jsErrorLog({device : "pc", func : "_jsSiteList.extendSiteView", error : e.message }); } /* utils */ function getCafeOrigin(url, isDefault) { if (url.indexOf('cafe.daum.net') != -1) { return 'Daum 카페'; } else if (url.indexOf('cafe.naver.com') != -1) { return '네이버 카페'; } else if (isDefault) { return '카페'; } else { return ''; } } function getBlogOrigin(url, isDefault){ if (url.indexOf('blog.daum.net') != -1) { return 'Daum 블로그'; } else if (url.indexOf('blog.naver.com') != -1) { return '네이버 블로그'; } else if (url.indexOf('tistory.com') != -1) { return '티스토리'; } else if (isDefault){ return '블로그'; } else { return ''; } } }
<% for (var i = 0, site; site = siteData[i]; i++) { %> <% if (site.fullAddress || site.phoneNumber) { %> <% } else { %> <% } %> <% if (site.content && site.collection != 'webdoc') { %>
<%=site.content%>
<% } %> <% if (site.cafeTags.length > 0) { %>
<% } %>
' target="<%=site.target%>"><%=site.etcData.shortUrl%> <% if (site.collection == 'site') { %> <% if (site.etcData.tags.length > 0) {%> <% for (var j = 0, etc; etc = site.etcData.tags[j]; j++) { %> <% if ( j > 0) { %> > <% } %>
' target="<%=site.target%>"><%=etc.tag%> <% } %> <% } %> <% } else if (site.collection == 'cafename') { %> <% if (site.etcData.cafeMember) { %>
회원수: <%=site.etcData.cafeMember%><% } %> <% if (site.etcData.cafeDttm) { %>
| 개설일: <%=site.etcData.cafeDttm%><% } %>
30102^<%=site.url%>^<%=site.docid%>^cafe^cafe^<%=site.url%> <% } else if (site.collection == 'blogname') { %> <% if (site.etcData.tag) { %>
별명: <%=site.etcData.tag%><% } %>
10403^<%=site.url%>^0 <% } else if (site.collection == 'webdoc') { %>
40101^<%=site.docid%>^<%=site.url%>^1^<%=site.sourceType%> 40102^<%=site.url%>^<%=site.url%>^0 <% } else if (site.collection == 'snspr') { %> <% if (site.etcData.paramTag && site.etcData.tag) { %> (
' target="<%=site.target%>"><%=site.etcData.tag%>) <% } %>
40302^<%=site.url%>^<%=site.docid%>^sns^channel^ <% } %>
<% if (site.fullAddress || site.phoneNumber) { %>
<%=site.fullAddress%> <%=site.phoneNumber%>
<% } %>
<% } %>
SF.C.Site = { getRelatedElems: function(id) { this.wrapElem = daum.$('wrap_' + id); this.layerElem = daum.$('layer_' + id); }, getLeftPosition: function(elem, parentElem) { return (elem) ? daum.Element.getCoords(elem, parentElem).left : 0; }, toggleLayer: function(id, btnElem, isShow) { this.getRelatedElems(id); if (this.wrapElem && this.layerElem) { this.layerElem.style.left = this.getLeftPosition(btnElem, this.wrapElem) + "px"; (isShow) ? daum.Element.show(this.layerElem) : daum.Element.hide(this.layerElem); } } };
<%
if (local.windowType == 'S') {
%>
<%
}
else {
%>
<% if (local.windowType != 'R') { %>
<%=local.addr%>
<% } %>
<% if (local.windowType == 'L') { %>
<%=local.phone%>
<% } %>
<% if ( local.removable ) { %>
닫기
<% } %>
<% } %>
&pg=1&r=1&rc=1&p=54&ext=localext%3Dnone|%EB%8C%80%EB%B2%95%EC%9B%90|H1109|");'>
<%=weather.temp%>℃
<%=weather.wtext5s%>
daum.maps.load(function() {
SF.M.loadCustomMapInfoWindow(); /* custom infowindow 모듈 로드 */
SF.C.Place = {
elemId: 'localCollMapArea',
mapData: [],
originalMapData: [],
markers: [],
markerImages:[],
infoWindows: [],
lines: [],
lineDots: [],
currentInfoWindow: null,
currentMarker: null,
currentIdx: -1,
selectedMarkerIdx:-1,
selectedMarker: null,
currentLevel: 4,
currentCenter: null,
currentRegionCode: '',
isDragSearch: false,
isActiveDragSearch: false,
SELECTED_ZINDEX: 10,
hasMinimap: ( ( (daum.Browser.ie && !daum.Browser.ie6) || daum.Browser.ff || daum.Browser.sf || daum.Browser.cr || daum.Browser.op) && (0 > 0 && ('exact' == 'area' || 'exact' == 'basic'))) ? true : false,
minimapDepth: '1',
localData: null,
findRouteContext: null,
isDataLoaded: false,
wnCount: 1,
selectedAddressLayer: null,
selectedYellowLayer: null,
marker: {
normal: {
path: 'place_mark1_num',
size: [25, 28],
realSize: [20, 28], /* png에서 그림자 영역을 제외한 순수한 이미지 영역의 크기 */
point: [10, 28],
type: 'L', /* 마커 크기 타입 */
infoWindowType: 'M',
zIndex: 3,
path_over: 'placemark1_num',
size_over: [40, 42],
realSize_over: [26, 42],
point_over: [15, 42]
},
special: {
path: 'place_mark2_num',
size: [25, 28],
realSize: [20, 28],
point: [10, 29],
type: 'L',
infoWindowType: 'M',
zIndex: 4,
path_over: 'placemark2_num',
size_over: [40, 42],
realSize_over: [26, 42],
point_over: [15, 42]
},
premium: {
path: 'place_mark3_num',
size: [25, 28],
realSize: [20, 28],
point: [10, 29],
type: 'L',
infoWindowType: 'M',
zIndex: 5,
path_over: 'placemark3_num',
size_over: [40, 42],
realSize_over: [26, 42],
point_over: [15, 42]
},
area: {
path: 'place_pointer_type2',
size: [40, 42],
realSize: [26, 42],
point: [12, 42],
type: 'L',
infoWindowType: 'M',
zIndex: 3
},
exact: {
path: 'place_pointer_type2',
size: [40, 42],
realSize: [26, 42],
point: [15, 42],
type: 'L',
infoWindowType: 'M',
zIndex: 3
},
'well_known': {
path: 'place_tile',
size: [8, 8],
realSize: [8, 8],
point: [4, 8],
type: 'S',
infoWindowType: 'S',
zIndex: 2
},
recommend: {
path: 'place_tile',
size: [0, 0],
realSize: [0, 0],
point: [0, 0],
type: 'R',
infoWindowType: 'R',
zIndex: 2
},
tile: {
path: 'place_bluedot',
size: [8, 8],
realSize: [8, 8],
point: [4, 8],
type: 'S',
infoWindowType: 'L',
zIndex: 2
},
line: {
path: 'place_mark5_num',
size: [25, 28],
realSize: [20, 28], /* png에서 그림자 영역을 제외한 순수한 이미지 영역의 크기 */
point: [10, 28],
type: 'L', /* 마커 크기 타입 */
infoWindowType: 'M',
zIndex: 3,
path_over: 'placemark1_linear',
size_over: [40, 42],
realSize_over: [26, 42],
point_over: [15, 42]
},
line_dot_on: {
path: 'place_linedot_on',
size: [9, 9],
realSize: [9, 9],
point: [5, 4],
type: 'S',
infoWindowType: 'L',
zIndex: 1
},
line_exact: {
path: 'place_exact',
size: [40, 42],
realSize: [26, 42],
point: [12, 42],
type: 'L',
infoWindowType: 'S',
zIndex: 3
},
line_dot_off: {
path: 'place_linedot_off',
size: [9, 9],
realSize: [9, 9],
point: [5, 4],
type: 'S',
infoWindowType: 'L',
zIndex: 1
}
},
infoWindowOffset: {
L: {
left: 4,
top: 43
},
M: {
left: 4,
top: 38
},
S: {
left: 4,
top: 16
},
R: {
left: 2,
top: 9
}
},
lineOption: {
activate: {
strokeColor:'#D9025C',
strokeWeight:4,
strokeOpacity:0.8
},
activate_other: {
strokeColor:'#FE378A',
strokeWeight:3,
strokeOpacity:0.6
},
deactivate: {
strokeColor:'#FE378A',
strokeWeight:3,
strokeOpacity:0.5
}
},
init: function( config ) {
this.type = config.type || '';
this.setElem();
this.loadData(); /* 미니맵 데이터 로드 */
this.bindEvents();
},
setElem: function() {
this.elem = daum.$('localColl');
this.mapElem = daum.$(this.elemId);
this.mapResultListElem = daum.$$('.wrap_list', this.elem)[0];
this.currentRelatedPlaceElem = ((daum.$$('a.btn_relplace', this.elem)[0])) ? daum.$E(daum.$$('a.btn_relplace', this.elem)[0].parentNode) : null; /* 관련 장소 */
this.currentDetailLayerElem = daum.$$('dl.highlighting', this.elem)[0] ? daum.$E(daum.$$('dl.highlighting', this.elem)[0].parentNode.parentNode) : null; /* 상세 레이어 */
},
/**
* 미니맵 데이터가 있을 경우 Raphaeljs, svg path data를 로드한 후 minimap 초기화 모듈을 호출한다.
*/
loadData: function() {
if (this.hasMinimap === true) {
var self = this;
if (typeof(Raphael) === 'undefined') {
daum.load('http://i1.search.daumcdn.net/s/search/js/raphael_2.1.2_min.js', function() {
self.minimap.init();
self.minimap.render('s');
});
}
}
},
/**
* 컬렉션 전체 영역의 click 이벤트 바인딩
* 지도 영역과 겹치는 관계로 지도 영역을 제외하고 지도 위/아래, 우측 면으로 쪼개었다;
* @function
*/
bindEvents: function() {
var self = this;
/* 주소 상세보기 레이어를 닫기 위한 click event */
daum.Event.addEvent( daum.$("daumWrap"), 'click', function(e) {
elem = daum.$E( daum.Event.getElement(e) );
var parentElem = (daum.$E( elem.parentNode )).getParent();
if (parentElem.id != 'minimap') {
/* TODO 모든 제외 클래스를 등록함. 이거 다른 방법 없을까?? */
if ( !elem.hasClassName('more_address') && !elem.hasClassName('bundle_address')
&& !elem.hasClassName('ico_type ico_type2') && !elem.hasClassName('layer_more') ) {
self.initAddressLayer();
}
}
});
/* event 등록 */
var listElems = daum.$$('.list_local');
for (var i = listElems.length; i--;) {
(function(i) {
var elem = listElems[i];
daum.Event.addEvent(elem, 'click', function(e) {
self.dispatchClickEvent(daum.Event.getElement(e), e);
});
daum.Event.addEvent(elem, 'mouseover', function(e) {
self.dispatchMouseoverEvent(daum.Event.getElement(e));
});
daum.Event.addEvent(elem, 'mouseout', function(e) {
self.dispatchMouseoutEvent(daum.Event.getElement(e), e);
});
})(i);
}
var placeNameElems = daum.$$('#localColl .tit_place');
for (var p = placeNameElems.length; p--;) {
(function(p) {
var elem = placeNameElems[p];
if (daum.Browser.webkit) {
daum.Event.addEvent(elem, 'mouseover', self.onMouseEnter(function() {
self.xxonMouseoverPlaceNameOrMarker(elem);
}));
daum.Event.addEvent(elem, 'mouseout', self.onMouseEnter(function() {
self.xxonMouseoutPlaceNameOrMarker(elem);
}));
} else {
daum.Event.addEvent(elem, 'mouseenter', function() {
self.xxonMouseoverPlaceNameOrMarker(elem);
});
daum.Event.addEvent(elem, 'mouseleave', function() {
self.xxonMouseoutPlaceNameOrMarker(elem);
});
}
})(p);
}
/* message */
var favoritePlaceElem = daum.$('favoritePlaceSelector');
if (favoritePlaceElem) {
daum.Event.addEvent(favoritePlaceElem, 'click', function(e) {
self.dispatchClickEvent(daum.Event.getElement(e))
});
}
var mapControlElem = daum.$$('.wrap_mapui', this.elem);
if (mapControlElem[0]) {
daum.Event.addEvent(mapControlElem[0], 'click', function(e) {
self.dispatchClickEvent(daum.Event.getElement(e))
});
}
var overlapPlaceElem = daum.$('toggleSameNames');
if (overlapPlaceElem) {
daum.Event.addEvent(overlapPlaceElem, 'click', function() {
self.toggleSameNames(overlapPlaceElem);
});
}
var inp_start_elem = daum.$('local_route_start');
if (inp_start_elem) {
daum.Event.addEvent(inp_start_elem, 'keydown', function(e) {
if (e.keyCode == 13) {
SF.C.Place.linkFindRoute(e, 'car');
}
});
}
var moreAddressLayerElemArr = daum.$$("#localColl .layer_more");
if (moreAddressLayerElemArr && moreAddressLayerElemArr.length > 0 ) {
var moreAddressLayerElem = null;
for (var i=0 ; i < moreAddressLayerElemArr.length ; i++) {
var item = moreAddressLayerElemArr[i];
daum.Event.addEvent(item, 'click', function(e) {
var elem = daum.Event.getElement(e);
daum.Event.stopEvent(e);
});
}
}
},
showYellowLayer: function(target) {
daum.Element.addClassName(target, 'info_open');
this.selectedYellowLayer = target;
},
hideYellowLayer: function(target) {
daum.Element.removeClassName(target, 'info_open');
this.selectedYellowLayer = null;
},
toggleYellowLayer: function(elem) {
try {
var self = this;
var selected = this.selectedYellowLayer;
var target = elem.parentElement;
if (selected && selected != target) {
self.hideYellowLayer(selected);
}
if (daum.Element.hasClassName (target, 'info_open')) {
self.hideYellowLayer(target);
}
else {
self.showYellowLayer(target);
}
}
catch (e) {}
},
/**
* 지도 컬렉션 영역 클릭시 해당하는 이벤트 핸들러를 호출한다.
* @function
* @param {Object} elem Object 이벤트 타겟 엘리먼트
*/
dispatchClickEvent: function(elem, event) {
elem = daum.$E(elem);
if (elem.hasClassName('ico_mark')) {
var idx = elem.getAttribute('data-local-idx');
var regionCode = elem.getAttribute('data-local-regionCode');
if (regionCode && this.hasMinimap) {
this.currentRegionCode = regionCode;
this.minimap.renderPinByRegionCode(this.currentRegionCode);
}
this.toggleInfoWindow('click', idx, true);
} else if (elem.id == 'local_route_start') {
if (elem.value === '출발지') {
elem.value = '';
}
} else if (elem.hasClassName('btn_enlarge')) { /* 확대 */
if (this.map.getLevel() > 1) {
this.map.setLevel(this.map.getLevel() - 1);
if (this.isActiveDragSearch === true) {
this.reloadMapData();
}
}
} else if (elem.hasClassName('btn_reduce')) { /* 축소 */
if (this.map.getLevel() < 15) {
this.map.setLevel(this.map.getLevel() + 1);
if (this.isActiveDragSearch === true) {
this.reloadMapData();
}
}
} else if (elem.hasClassName('btn_whole')) { /* 큰 지도 보기 */
this.linkFullMap();
} else if (elem.hasClassName('btn_reset')) { /* 지도 초기화 */
this.renderOriginalMap();
} else if (elem.id == 'favoritePlaceSelector') { /* 관심 지역 */
this.toggleFavoritePlaceList();
} else if (elem.hasClassName('btn_relplace')) { /* 관련 장소 */
this.toggleRelatedPlaceList(elem);
} else if (elem.hasClassName('link_detail') || elem.hasClassName('btn_detail') ) { /* 관련 장소 */
this.toggleDetailLayer(elem);
}
else if (elem.hasClassName('more_address')) { /* 주소 펼쳐보기 */
this.toggleMoreAddress(elem);
} else if (elem.id === 'local_route_car') {
SF.C.Place.linkFindRoute(event, 'car');
} else if (elem.id === 'local_route_traffic') {
SF.C.Place.linkFindRoute(event, 'traffic');
} else if (elem.hasClassName('link_yellow')) {
SF.C.Place.toggleYellowLayer (elem);
} else if (elem.hasClassName('btn_localcoll_yellow') || elem.hasClassName('label_localcoll_yellow')) {
SF.C.Place.hideYellowLayer(SF.C.Place.selectedYellowLayer);
}
},
/**
* 지도 컬렉션 영역 마우스오버시 해당하는 이벤트 핸들러를 호출한다.
* @function
* @param {Object} elem Object 이벤트 타겟 엘리먼트
*/
dispatchMouseoverEvent: function(elem) {
elem = daum.$E(elem);
var tagName = elem.tagName;
if (elem.hasClassName('ico_mark')) { /* 결과 목록 앞에 마커 */
this.xxonMouseoverPlaceNameOrMarker(elem);
} else if (elem.hasClassName('more_address')) { /* 주소 펼쳐보기 */
this.xxonMouseoverMoreAddress(elem);
}
},
/**
* 지도 컬렉션 영역 마우스아웃시 해당하는 이벤트 핸들러를 호출한다.
* @function
* @param {Object} elem Object 이벤트 타겟 엘리먼트
*/
dispatchMouseoutEvent: function(elem, e) {
elem = daum.$E(elem);
if (elem.hasClassName('ico_mark')) {
this.xxonMouseoutPlaceNameOrMarker(elem);
} else if (elem.hasClassName('more_address')) {
this.xxonMouseoutMoreAddress(elem);
}
},
/* 컬렉션 내 마커나 장소명위에 마우스를 아웃했을 때 */
[안내]태그제한으로등록되지않습니다-xxonMouseoutPlaceNameOrMarker: function(elem) {
var idx = elem.getAttribute('data-local-idx');
var regionCode = elem.getAttribute('data-local-regionCode');
var markerType = this.mapData[idx].type;
if (regionCode && this.hasMinimap) {
if (this.hasContainMap(idx)) {
if (this.currentInfoWindowType == 'S') {
this.clearInfoWindow();
this.clearMarker();
}
} else {
this.minimap.renderPinByRegionCode(this.currentRegionCode);
}
}else {
if (this.currentInfoWindowType == 'S') {
this.clearInfoWindow();
this.clearMarker();
}
}
this.toggleMarkerOver( markerType, idx, false);
/* 라인 옵션 변경. */
this.deactivateLine( idx );
if ( this.currentSelectedInfoWindow && this.selectedMarkerIdx > -1) { /* 선택된 마커가 있으면, 다른 마커를 마우스오버하고 아웃했을 때, 선택된 마커의 라인을 강조시킨다. */
this.activateLine(this.selectedMarkerIdx);
}
},
/* 컬렉션 내 마커나 장소명위에 마우스를 오버했을 때 */
/*
* 컬렉션 내에는 타일 형태인 웰논포인트는 카운트하지 않기 때문에 index 문제가 없음
*/
[안내]태그제한으로등록되지않습니다-xxonMouseoverPlaceNameOrMarker: function(elem) {
var idx = elem.getAttribute('data-local-idx');
var markerType = this.mapData[idx].type;
var regionCode = elem.getAttribute('data-local-regionCode');
if( idx ) {
if (regionCode && this.hasMinimap) {
if (this.hasContainMap(idx)) {
if (idx != this.selectedMarkerIdx) {
this.toggleInfoWindow('mouseover', idx, true);
this.toggleMarkerOver(markerType,idx, true);
}
} else {
this.minimap.renderPinByRegionCode(regionCode);
}
} else {
if (idx != this.selectedMarkerIdx) {
this.toggleInfoWindow('mouseover', idx, true);
this.toggleMarkerOver(markerType,idx, true);
}
}
/* 라인 옵션 변경. */
this.activateLine( idx );
}
},
/*
* 주소영역에 마우스 오버하면, 새주소/구주소 레이어 노출.
*/
[안내]태그제한으로등록되지않습니다-xxonMouseoverMoreAddress: function(elem) {
if ( this.selectedAddressLayer == null ) {
var parentElem = daum.$E(elem.parentNode);
if (parentElem) {
(parentElem.hasClassName('layer_open')) ? null : parentElem.addClassName('layer_open');
}
}
},
[안내]태그제한으로등록되지않습니다-xxonMouseoutMoreAddress: function(elem) {
if ( this.selectedAddressLayer == null ) {
var parentElem = daum.$E(elem.parentNode);
if (parentElem) {
(parentElem.hasClassName('layer_open')) ? parentElem.removeClassName('layer_open') : null;
}
}
},
/* extended function */
getParentNode: function(elem, nodename) {
var el = elem;
while (el && el !== parent) {
if (el.nodeName === nodename) {
return el;
} else {
el = el.parentNode;
}
}
},
/**
* 해당 index의 좌표가 현재 지도 영역에 있는지 여부를 반환한다.
* @param {Number} index SF.C.Place.mapData의 index
* @return {Boolean} 현재 지도 영역에 있는지 여부
*/
hasContainMap: function(index) {
var position = this.mapData[index].position,
bounds = this.map.getBounds();
return !!(bounds.contain(position));
},
/**
* 마커 또는 컬렉션 내 장소명을 mouseover 했을 때 마커 크기를 변경한다.
*
*/
toggleMarkerOver: function (markerType, idx, isOver) {
var markerIdx = idx;
if (this.currentSelectedInfoWindow) {
if (this.selectedMarkerIdx == markerIdx) {
return;
}
}
if (markerType == "normal" || markerType == "special" || markerType == "premium") {
if (this.markerImages[idx]) {
if (isOver) {
this.markers[markerIdx].setImage(this.markerImages[idx][1]);
}
else {
this.markers[markerIdx].setImage(this.markerImages[idx][0]);
}
}
}
},
/**
* 관심 지역 리스트 영역을 토글한다.
*/
toggleFavoritePlaceList: function() {
var elem = daum.$$('div.select_place', this.elem);
if (elem[0]) {
(daum.Element.hasClassName(elem[0], 'open')) ? daum.Element.removeClassName(elem[0], 'open') : daum.Element.addClassName(elem[0], 'open');
}
},
/**
* 관련 지역 리스트 영역에 open 클래스를 추가/삭제하여 토글한다.
* open 클래스를 추가한 엘리먼트를 currentRelatedPlaceElem에서 참조하고, 이후 토글시에 해당 값이 있으면 open 클래스를 제거한 후 토글을 실행한다.
* @param {Object} elem 관심 지역 토글 트리거 엘리먼트의 레퍼런스
*/
toggleRelatedPlaceList: function(elem) {
var parentElem = daum.$E(elem.parentNode);
if (parentElem) {
if (this.currentRelatedPlaceElem && this.currentRelatedPlaceElem !== parentElem) {
this.currentRelatedPlaceElem.removeClassName('open');
}
(parentElem.hasClassName('open')) ? parentElem.removeClassName('open') : parentElem.addClassName('open');
this.currentRelatedPlaceElem = parentElem;
}
},
/**
* 관련 지역 리스트 영역에 open 클래스를 추가/삭제하여 토글한다.
* open 클래스를 추가한 엘리먼트를 currentRelatedPlaceElem에서 참조하고, 이후 토글시에 해당 값이 있으면 open 클래스를 제거한 후 토글을 실행한다.
* @param {Object} elem 관심 지역 토글 트리거 엘리먼트의 레퍼런스
*/
toggleDetailLayer: function(elem) {
var detailLayer = daum.$E(elem);
while(detailLayer && !detailLayer.hasClassName('info_more')) {
detailLayer = daum.$E(daum.Element.getParent(detailLayer));
}
if (detailLayer) {
if (this.currentDetailLayerElem && this.currentDetailLayerElem != detailLayer) {
this.currentDetailLayerElem.removeClassName('detail_opne');
}
(detailLayer.hasClassName('detail_opne')) ? detailLayer.removeClassName('detail_opne') : detailLayer.addClassName('detail_opne');
this.currentDetailLayerElem = detailLayer;
}
},
/**
* 주소 옆의 버튼 클릭시 주소 더보기 레이어를 출력한다.
* info_more 클래스에 layer_open 클래스 추가.
* @param {Object} elem 관심 지역 토글 트리거 엘리먼트의 레퍼런스
*/
toggleMoreAddress: function(elem) {
var parentElem = daum.$E(elem.parentNode);
if (parentElem) {
if (parentElem.hasClassName('layer_open')) {
if( this.selectedAddressLayer == null ) {
this.selectedAddressLayer = parentElem;
} else {
this.selectedAddressLayer = null;
parentElem.removeClassName('layer_open');
}
} else {
if( this.selectedAddressLayer == null ) {
this.selectedAddressLayer = parentElem;
parentElem.addClassName('layer_open');
} else {
this.selectedAddressLayer.removeClassName('layer_open');
this.selectedAddressLayer = parentElem;
parentElem.addClassName('layer_open');
}
}
}
},
initAddressLayer: function() {
if( this.selectedAddressLayer != null ) {
this.selectedAddressLayer.removeClassName('layer_open');
this.selectedAddressLayer = null;
}
},
/**
* 섹션의 길찾기 화면으로 새 창을 띄운다.
* @function
* @param Object elem 출발지명 input box 레퍼런스
*/
linkFindRoute: function(event, type) {
if (!this.findRouteContext) {
return;
}
var targetElem = daum.$('local_route_start'),
obj = this.findRouteContext,
placename = targetElem.value,
win;
if (!placename || placename == "출발지") {
alert('출발지를 입력해 주세요.');
targetElem.select();
} else {
var p = '',
mapType = SF.C.Place.type;
if (type === 'car') {
p = 45;
} else if (type === 'traffic') {
p = 46;
}
smartLog(null, 'a=BQZX&s=TO&dc=MOU&pg=1&r=1&p=' + p + '&rc=1', event);
var ids = ",P" + obj.docid;
win = window.open("http://map.daum.net/?SP=RIS&map_type=TYPE_MAP&map_hybrid=false&sName="+ encodeURIComponent(placename) +"&eName="+ encodeURIComponent(obj.eName) +"&eX="+ obj['point_wx'] +"&eY="+ obj['point_wy'] + "&ids=" + ids + '&target=' + type, 'RouteBrowser');
win.focus();
}
},
/**
* 지도 위에 info window 출력시 필요한 데이터를 추가한다.
* @function
* @param obj Object
*/
addMapData: function( obj, isOriginalData ) {
this.mapData.push(obj);
if (isOriginalData === true) {
this.originalMapData.push(obj);
}
},
/**
* 지도를 출력한다.
* @function
* @param {daum.maps.Coords} centerPosition area 템플릿의 경우 센터 좌표값
*/
render: function( centerPosition ) {
var map, data,
infoWindow,
polyData,
bounds = new daum.maps.CoordsBounds(),
prevMarkerType = '', markerType = '',
idx = 1,
firstResultIndex = -1,
isUseLine = false,
self = this;
map = this.makeMap(centerPosition);
if ( centerPosition ) {
this.currentCenter = centerPosition; /* area type 시 초기화를 위해 */
this.setAreaMarker(map, centerPosition);
bounds.extend(centerPosition);
}
for (var p = 0, pl = this.mapData.length; p < pl; p++) {
data = this.mapData[p];
markerType = data.type;
polyData = data.line_data;
isLine = false;
if( polyData != '' && polyData != undefined ) {
isLine = true;
}
if (prevMarkerType != 'special' && prevMarkerType != markerType) {
idx = 1;
}
prevMarkerType = markerType;
this.markers.push( this.makeMarker(data.position, markerType, idx, isLine) );
idx += 1;
this.markers[p].setMap(map);
this.setMarkerZIndex(p);
/* 마커를 모두 보여주는 지도 배율을 설정하기 위해, 타일링 결과는 포함하지 않는다 */
if (markerType != 'tile') {
if (this.hasMinimap && markerType == 'normal') {
if (this.isSameRegionWithFirstResult(p)) {
bounds.extend(data.position);
}
} else {
bounds.extend(data.position);
}
}
/* 마커 이벤트 바인딩 */
this.bindMarkerEvents(p, markerType, data.docid);
if ( ( markerType === 'normal' || markerType == 'exact' ) && firstResultIndex < 0) {
firstResultIndex = p;
}
/* 폴리라인 생성 추가 */
if ( isLine ) {
/* polyData가 하나라도 있는지 체크 */
if(!isUseLine) {
isUseLine = true;
}
/* ^ 구분자가 있으면 장소 */
var polyset = this.drawPlacePolyLine( p );
/* 선형 노출 */
var line_set = []
for( var i = 0; i < polyset.positions.length; i++ ) {
line_set[i] = new daum.maps.Polyline();
line_set[i].setOptions( this.lineOption.deactivate );
line_set[i].setPath( polyset.positions[i] );
line_set[i].setMap( map );
}
this.lines.push( line_set );
/* 라인의 시작점, 끝점 추가. */
var lineDot_set = [];
lineDot_set[0] = this.makeLineDotMarker( "line_dot_off", polyset.spoint, 1 );
lineDot_set[0].setMap( map );
lineDot_set[1] = this.makeLineDotMarker( "line_dot_off", polyset.epoint, 1 );
lineDot_set[1].setMap( map );
this.lineDots.push( lineDot_set );
/* 선형 데이터이므로 마커의 중심 좌표를 변경한다. */
this.markers[p].setPosition( polyset.center );
/* mapData의 마커 중심도 바꿔준다. 추후 infoWindow 등에 사용. */
this.mapData[p].position = polyset.center;
/* line에서 추출한 bounds 추가 */
for( var i = 0; i < polyset.lineBounds.length; i++ ) {
bounds.extend( polyset.lineBounds[i] );
}
} else {
this.lines.push( null );
this.lineDots.push( null );
}
}
if (!this.isActiveDragSearch) {
map.setBounds(bounds);
}
this.markers[0].setZIndex(10);
/* 최초 1회만 바인딩 */
if ( !this.map ) {
this.bindMapEvents(map);
}
this.map = map;
/* 웰논포인트 bound 추가. 라인정보가 하나라도 있으면 웰논포인트 제거 */
if (firstResultIndex !== -1 && !isUseLine ) {
this.renderWellKnownPoints(firstResultIndex);
}
this.mapBounds = bounds;
},
/**
* 지도에 이벤트를 바인딩하는 메소드
* 1) dragstart: S 타입의 인포윈도우는 닫는다
* 2) click: 모든 타입의 인포윈도우를 닫는다
* 3) minimap이 있을 경우 마우스 포인터가 지도 위에 있거나, mapElem에서 벗어날 경우 미니맵을 's' 타입으로 변경한다.
*/
bindMapEvents: function(map) {
var self = this;
daum.maps.event.addListener(map, 'dragstart', function() {
if (self.currentInfoWindowType == 'S') {
self.clearInfoWindow();
}
});
daum.maps.event.addListener(map, 'click', function(e) {
self.initMarkerAndInfoWindow();
});
/*
지도가 움직일 때 라인 마커가 없어지는 것을 복원함.
*/
daum.maps.event.addListener(map, 'dragend', function () {
/* 지도 중심 좌표 변화 이벤트 */
if (self.currentSelectedInfoWindow && self.selectedMarkerIdx != -1) {
self.activateLine(self.selectedMarkerIdx);
}
});
/*
지도가 움직일 때 라인 마커가 없어지는 것을 복원함.
*/
daum.maps.event.addListener(map, 'center_changed', function () {
/* 지도 중심 좌표 변화 이벤트 */
if (self.currentSelectedInfoWindow && self.selectedMarkerIdx != -1) {
self.activateLine(self.selectedMarkerIdx);
}
});
},
/**
* 장소용 폴리라인을 생성하는 함수 by itisfun.
* TODO: data.position은 어디서 쓰지?
* TODO: this.line_position은 어디서 쓰지????
* 장소 라인 데이터 - center^start^end^line1@line2@line3^bound@bound
* TODO: center, start, end 사용처 확인. 없으면 빼자.
*/
drawPlacePolyLine: function( data_index ) {
var data = this.mapData[ data_index ],
line_data = data.line_data,
position = data.position;
var arr_line_data = line_data.split("^");
var center = new daum.maps.Coords( arr_line_data[0].split(",")[0], arr_line_data[0].split(",")[1] );
var startp = new daum.maps.Coords( arr_line_data[1].split(",")[0], arr_line_data[1].split(",")[1] );
var endp = new daum.maps.Coords( arr_line_data[2].split(",")[0], arr_line_data[2].split(",")[1] );
var temp_lines = arr_line_data[3].split("@");
var bounds = arr_line_data[4].split("@");
/* line 추출. line은 x,y|x,y 구조 */
var line_set = [];
for( var j=0; j < temp_lines.length; j++ ) {
var line_positions = [];
var line = temp_lines[j].split("|");
if (line.length > 1){
for (var i=0, g=line;i 0) {
this.lines.splice(0, 1);
this.lineDots.splice(0, 1);
}
},
/* line dot 마커를 생성한다. */
makeLineDotMarker: function( type, position, zIndex ) {
/**
var billBoard = new daum.maps.Billboard();
billBoard.setContent( content );
billBoard.setPosition( position );
billBoard.setZIndex( zIndex );
return billBoard;
**/
var lineDot = new daum.maps.Marker( {draggable:false,clickable:false} );
lineDot.setImage( this.getMarkerImageUrl( type ) );
lineDot.setPosition( position );
lineDot.setZIndex( this.marker[type].zIndex );
return lineDot;
},
/**
* 해당 인덱스의 웰논포인트를 지도 배율에 포함되도록 처리한다.
* @param {Number} index SF.C.Place.mapData의 인덱스 값
*/
renderWellKnownPoints: function(index) {
var points = this.mapData[index].wellKnowns;
if (!points || daum.String.trim(points).length === 0) {
return;
}
var map = this.map,
marker,
bounds = this.map.getBounds(),
position, data = [];
points = points.split('|');
for (var i = 0, l = this.wnCount; i < l; i++) {
data = points[i].split('^');
position = new daum.maps.Coords(data[1], data[2]);
marker = this.makeMarker(position, 'well_known');
if (bounds.contain(position) === false) {
bounds.extend(position);
}
}
this.type === 'exact' ? map.setBounds(bounds, 50) : map.setBounds(bounds, 0);
this.mapBounds = bounds;
},
makeMap: function(centerPosition) {
if (this.map) {
return this.map;
}
return new daum.maps.Map(this.mapElem, {
center: (centerPosition) ? centerPosition : this.getCenter(),
scrollwheel: false,
level: 4
});
},
/**
* mapData 배열의 해당 인덱스 마커 타입을 반환한다.
* @param {Number} i mapData 배열의 인덱스
* @return {String} 해당 마커의 type 프로퍼티 값
*/
getMarkerType: function(i) {
return this.marker[this.mapData[i].type].type || undefined;
},
/**
* @param {daum.maps} map 지도 객체 레퍼런스
* @param {daum.maps.Coords} position 좌표값
*/
setAreaMarker: function(map, position) {
var areaMarker = this.makeMarker(position, 'area');
areaMarker.setMap(map);
},
/**
* 마커 인스턴스를 생성하고 position 좌표에 출력한다.
* @param {daum.maps.Coords} position 좌표
* @param {String} markerType SF.C.Place.marker의 type 데이터 값
* @return {daum.maps.Marker} 마커 인스턴스
*/
makeMarker: function(position, markerType, idx, isLine) {
idx = (idx) ? idx : '';
return new daum.maps.Marker({
position: position,
image: this.getMarkerImageUrl(markerType, idx, isLine)
});
},
/**
* 지도에 출력할 마커 인스턴스를 생성해서 반환한다.
* @param {String} markerType SF.C.Place.marker의 type 프로퍼티 값
* @param {Number} idx 마커의 인덱스 값
* @return {daum.maps.MarkerImage} 마커 인스턴스
*/
getMarkerImageUrl: function(markerType, idx, isLine) {
idx = idx ? idx : '';
var config = null;
if ( isLine && markerType == "exact" ) {
config = this.marker["line_exact"];
}
else if ( isLine && markerType != "tile" ) {
config = this.marker["line"];
}
else {
config = this.marker[markerType];
}
var hasOverImage = (markerType == 'normal' || markerType == 'special' || markerType == 'premium' || markerType == 'line' );
var path = hasOverImage ? config.path + idx : config.path;
var imageBaseUrl = 'http://i1.search.daumcdn.net/s/search_all/2012/image/' + path + '.png';
if (hasOverImage) {
imageBaseUrl = 'http://i1.search.daumcdn.net/s/search_all/2014/place/' + path + '.png';
}
var markerImage = new daum.maps.MarkerImage(
imageBaseUrl,
new daum.maps.Size(config.size[0], config.size[1]),
new daum.maps.Point(config.point[0], config.point[1]));
if (hasOverImage) {
var markerOverImage = new daum.maps.MarkerImage(
'http://i1.search.daumcdn.net/s/search_all/2014/place/'+ config.path_over + (idx) +'_over.png',
new daum.maps.Size(config.size_over[0], config.size_over[1]),
new daum.maps.Point(config.point_over[0], config.point_over[1]));
var item = new Array(2);
item[0] = markerImage;
item[1] = markerOverImage;
this.markerImages.push(item);
}
return markerImage;
},
/**
* 해당 마커의 zIndex 값을 설정한다
* @param {Number} i 데이터의 인덱스 값
*/
setMarkerZIndex: function(i) {
var type = this.mapData[i].type;
var marker = this.markers[i];
if (type && marker) {
this.markers[i].setZIndex(this.marker[type].zIndex);
}
},
/**
* 해당 데이터의 마커 zIndex를 상위로 높인다.
* 활성화된 마커가 있을 경우 zIndex를 0으로 낮춘다.
* @function
* @param Number i 해당 데이터의 인덱스
**/
resetMarker: function(i) {
var type = this.mapData[i].type;
this.markers[i].setZIndex( this.marker[type].zIndex * 10 );
this.currentMarker = this.markers[i];
},
/**
* @function
* zIndex를 초기화 하고, 현재 마커를 가리키는 변수에 null 대입
**/
clearMarker: function() {
if (this.currentMarker) {
this.setMarkerZIndex(this.currentIdx);
this.currentMarker = null;
}
},
bindMarkerEvents: function(index, markerType, docid) {
var self = this;
docid = docid || '';
var hasOverMarkerType = (markerType == "normal" || markerType == "special" || markerType == "premium");
daum.maps.event.addListener(self.markers[index], 'click', function() {
/* 정답형 타입들은 클릭시에 섹션으로 보낸다.
* 주소형 타입은 클릭시 섹션으로 보낸다.
*/
if (markerType != 'area' && markerType != 'exact') {
self.initMarkerAndInfoWindow();
self.resetMarker(index); /* ZIndex 높은 인덱스로 설정하고 */
self.resetInfoWindow('click', index, true, true); /* 클릭한 인포윈도우 띄운다. */
if (hasOverMarkerType) {
/* 선택한 마커의 사이즈를 확대한다. */
var curIdx = self.selectedMarkerIdx;
self.markers[curIdx].setImage( self.markerImages[curIdx][1] );
}
/* 마커의 리스트상 번호 */
var list_idx = index + 1;
var eventElem = daum.Event.getElement(event);
if (eventElem) {
smartLog(eventElem, "a=BQZX&s=TO&dc=MOU&d=" + docid + "&pg=1&r=" + list_idx + "&rc=1&p=65");
}
} else {
self.linkToLocalClickMarker(docid);
}
});
if (markerType != 'area') {
daum.maps.event.addListener(self.markers[index], 'mouseover', function() {
if (index != self.selectedMarkerIdx) {
self.resetMarker(index);
self.resetInfoWindow('mouseover', index, false, false);
if (hasOverMarkerType) {
self.toggleMarkerOver( markerType, index, true);
}
}
/* 라인 정보 변경 */
self.activateLine( index );
});
daum.maps.event.addListener(self.markers[index], 'mouseout', function() {
if (self.currentInfoWindowType == 'S') {
self.clearInfoWindow();
if (index != self.selectedMarkerIdx) {
self.clearMarker();
if (hasOverMarkerType) {
self.toggleMarkerOver( markerType, index, false);
}
}
}
/* 라인 정보 변경 */
self.deactivateLine( index );
if (self.currentSelectedInfoWindow && self.selectedMarkerIdx > -1) {
self.activateLine(self.selectedMarkerIdx);
}
});
}
},
/**
* 큰 지도 보기 링크 생성 후 새창으로 띄운다.
* @function
*/
linkFullMap: function(docid) {
var host = '', queryString = [],
params = {},
win,
mapTypeId = this.map.getMapTypeId();
if (this.isDragSearch) {
/* 지도 이동 검색일 경우 */
} else {
host = 'http://map.daum.net/';
params = {
q: encodeURIComponent("대법원"),
map_type: ( mapTypeId === 1 ) ? 'DEFAULT' : 'TYPE_SKYVIEW',
map_hybrid: ( mapTypeId === 1 ) ? 'false' : 'true',
srcid: docid || undefined, /* 정답형일 때 entry.docid */
itemId: docid || undefined
};
}
for (var i in params) {
if (params.hasOwnProperty(i) && params[i]) {
queryString.push(i + '=' + params[i]);
}
}
queryString = queryString.join('&');
win = window.open(host + '?' + queryString, 'MapBrowser');
win.focus();
},
/**
* 정답형에서 마커 클릭시 섹션 페이지를 새 창으로 띄워준다.
*/
linkToLocalClickMarker: function(docid) {
if (!docid) {
return;
}
var win = window.open('http://place.map.daum.net/' + docid, 'MapBrowser');
win.focus();
},
getCenter: function(data) {
return (data) ? data[0].position : this.mapData[0].position;
},
/**
* mapData 배열의 해당 인덱스 마커의 인포윈도우 타입을 반환한다.
* @param {Number} i mapData 배열의 인덱스
* @return {String} 해당 마커의 infoWindowType 프로퍼티 값
*/
getInfoWindowType: function(i) {
return this.marker[this.mapData[i].type].infoWindowType || undefined;
},
/**
* 템플릿 데이터를 입력받고 custom info window의 html string을 반환한다.
* @function
* @param Object templateData 템플릿 데이터
*/
getInfoWindow: function(templateData) {
return SF.M.tmpl('localCustomInfoWindow', templateData);
},
/** 2
* customInfoWindow 및 화살표 엘리먼트의 위치값을 설정한다.
* customInfoWindow 타입이 다양해지면서 지저분한 상수값이 쓰여버렸다...
* @param {Object} node customInfoWindow 엘리먼트의 레퍼런스
* @param {Object} point 좌표값을 css로 변환한 값
* @param {Object} offset 마커 종류별로 customInfoWindow 위치에 필요한 조정값, SF.C.Place.offset
* @param {String} infoWindowType customInfoWindow의 타입 값
* @param {Object} markerSize 마커 이미지의 가로, 세로 px 값을 담고 있는 배열
*/
renderInfoWindow: function(node, point, offset, infoWindowType, markerSize, index) {
var mapElem = this.mapElem; /* map이 그려지는 division */
/* getBoundingClientRect() 메소드를 지원하지 않는 브라우저에서는 포기 */
if (!mapElem.getBoundingClientRect) {
return;
}
/* [1] S형 인포윈도우 일 때 : 마우스 오버 시 나타나는 툴팁 */
if (infoWindowType == 'S') {
/* 1.S형 인포윈도우 html에서 class 및 속성 추가 */
node.children[0].children[0].className = "layer_left";
node.style.cssText = 'position: absolute; z-index:900;cursor:default;';
/* 2. S형 인포윈도우와 매칭된 지도 위 마커의 위치에 따라 인포윈도우 안 텍스트 길이 조절하는 로직 */
if (this.currentMarker) {
var mapProjection = this.map.getProjection();
var coords = null; /* 마커의 W콩나물 위치 값 저장하는 오브젝트 */
var pos = null; /* 지도위 마커의 x,y 좌표 오브젝트 */
var markerX = -1;
var markerY = -1;
var placeName = "";
coords = this.currentMarker.getPosition();
/* 2-1. 해당 마커의 W콩나물좌표값을 얻고 지도엘리먼트에서의 x, y값을 얻는다. */
if (coords) {
pos = mapProjection.containerPointFromCoords(coords);
if (pos) {
markerX = pos.x;
markerY = pos.y;
}
}
var placeNameElem = daum.$("layer_place_name");
if (placeNameElem) {
placeName = placeNameElem.getAttribute("data-placename") || "";
}
/*
* 2-2. 지도 영역을 5등분으로 나누어 인포윈도우 내 텍스트 길이를 조절한다.
* 한 칸당 52px, 지도는 가로 260px
*/
if (placeNameElem != null && placeName != "") {
/* 1번째, 5번째 구역 */
if (markerX >0 && markerX <=52 || markerX > 208 && markerX <= 260) {
placeNameElem.textContent = this.cutString(placeName, 30, "..");
}
/* 2번째, 4번쨰 구역 */
else if (markerX > 52 && markerX <=104 || markerX > 156 && markerX <= 208) {
placeNameElem.textContent = this.cutString(placeName, 24, "..");
}
/* 3번째(가운데) 구역 */
else if (markerX > 104 && markerX <=156 ) {
placeNameElem.textContent = this.cutString(placeName, 16, "..");
}
}
}
/* 3. 인포윈도우 위치 조절하는 로직 */
var width = node.offsetWidth;
var height = node.offsetHeight;
/* 3-1. 타일형과 같은 작은 마커일 때 위치를 조절한다. */
var smallMarkerOffset = 0;
var smallMarkerTopOffset = 0;
if (markerSize[0]==8 && markerSize[1]==8) {
smallMarkerOffset = 4;
smallMarkerTopOffset = 0;
}
else {
smallMarkerTopOffset = -8;
}
node.style.left = point.x + ( markerSize[0] / 2 ) - 2 + smallMarkerOffset + 'px';
node.style.top = ( point.y - ((markerSize[1] / 2) + (height / 2))) + smallMarkerTopOffset + 'px';
var mapRect = mapElem.getBoundingClientRect();
var selfRect = node.getBoundingClientRect();
if (selfRect.right >= mapRect.right ) {
daum.Element.replaceClassName( node.children[0].children[0], 'layer_left', "layer_right");
node.style.left = parseInt(node.style.left) - width - markerSize[0] - 2- smallMarkerOffset + 'px';
}
}
/* [2] M형, L형 인포윈도우 : 마커 클릭 후 나타나는 인포윈도우 */
else {
/* renderInfoWindow 함수 반복 호출 방지
if(!(index==this.selectedMarkerIdx && infoWindowType==this.currentInfoWindowType)) {
return;
}
*/
/* 1. 엘리먼트 속성 설정 */
node.style.cssText = 'position: absolute; z-index:999;cursor:default;';
/* 2. 인포윈도우 내 글자 수 조절 */
var placeNameElem = daum.$('layertip_place_name');
if (placeNameElem) {
var placeName = placeNameElem.getAttribute("data-placename") || "";
if (placeName != "") {
placeNameElem.textContent = this.cutString(placeName, 26, "..");
}
}
/* 3. 인포윈도우 위치 조절 */
var width = node.offsetWidth;
var height = node.offsetHeight;
node.style.left = (point.x - width/2 - offset.left) + 'px';
if (infoWindowType=='M') {
node.style.top = (point.y - height - offset.top)-8 + 'px';
}
else {
node.style.top = (point.y - height - offset.top) + 'px';
}
/* 인포윈도우의 가로 너비가 유동적이기 때문에 인포윈도우 하단에 화살표의 left 값을 지정해줘야 한다. 마커의 너비에 따라 분기를 타고 있음 */
if (infoWindowType == 'R' || infoWindowType == 'L') {
daum.$$('.arrow', node)[0].style.left = width/2 - 3 + 'px';
}
}
this.layerMousedownEvent = daum.Event.addEvent(node, 'mousedown', function(e) {
daum.Event.stopEvent(e);
});
},
/**
* 활성화된 인포윈도우가 있을 경우 닫는다.
* @function
**/
clearInfoWindow: function() {
if (this.currentInfoWindow) {
this.currentInfoWindow.onRemove();
this.currentInfoWindow = null;
this.currentInfoWindowType = null;
}
},
/**
* 활성화된 클릭해서 닫는 인포윈도우가 있을 경우 닫는다.
* @function
**/
clearSelectedInfoWindow: function() {
if (this.currentSelectedInfoWindow) {
if (this.layerMousedownEvent) {
daum.Event.stopObserving(this.layerMousedownEvent);
}
this.currentSelectedInfoWindow.onRemove();
this.currentSelectedInfoWindow = null;
}
},
/**
* 지도 내에서 이벤트 발생 후 마커와 인포윈도우를 초기화 하는 함수
* 모든 이벤트가 발생할 때 마다 발생한 것이기 때문에 함수화
* 이 함수를 호출하는 시점은
* 1. 맵 지도 영역 클릭 시
* 2. M,L형 인포윈도우 '닫기'버튼 클릭 시
* 3. 다른 마커 클릭 시
*
**/
initMarkerAndInfoWindow: function() {
/* 1. 이전에 클릭했던(확대되었던) 마커 사이즈 축소시킨다.*/
var index = this.selectedMarkerIdx;
if (index > -1 && index <= this.markerImages.length-1 && this.markerImages[index] ) {
this.markers[index].setImage(this.markerImages[index][0]);
/* 2. 선택된 인포윈도우가 있을 때 마커윈도우 ZIndex를 기존 값으로 내린다. */
this.setMarkerZIndex(index);
/* 3. 라인데이터 강조를 OFF한다. */
this.deactivateLine(this.selectedMarkerIdx);
}
/* 4. 인포윈도우를 모두 닫는다. */
this.clearInfoWindow();
this.clearSelectedInfoWindow();
/* 5. 선택된 마커 인덱스 -1로 수정 */
this.selectedMarkerIdx = -1;
},
/** 1
* 해당 데이터의 인포윈도우를 출력한다.
* 활성화된 인포윈도우가 있을 경우 닫는다.
* 닫기 버튼이 표시된 인포윈도의 경우는 지도상에 1개만 존재하며, 사용자가 닫기 버튼을 클릭해야 닫을 수 있다.
* 나머지 인포윈도우는 마커에 mouseout이 되거나, 다른 마커에 mouseover되면 닫힌다.
* @function
* @param {String} eventType 이벤트 타입, 지도 event handler에서 이벤트 객체를 받지 못하는 이유로 eventType을 굳이 받음...
* @param {Number} i 해당 데이터의 인덱스
* @param {Boolean} removable 레이어에 닫기 버튼 표시 여부
* @param {Boolean} isChangeCenter 지도 센터 변경 여부
**/
resetInfoWindow: function(eventType, i, removable, isChangeCenter) {
var template, infoWindow,
markerType = this.getMarkerType(i),
offset = this.infoWindowOffset[markerType],
mapData = this.mapData[i],
infoWindowType = (mapData.type === 'recommend') ? 'R' : (eventType == 'mouseover') ? 'S' : this.getInfoWindowType(i),
markerSize = this.marker[mapData.type].realSize,
self = this;
if (mapData.type=="normal" || mapData.type=="special" || mapData.type=="premium") {
markerSize = this.marker[mapData.type].realSize_over;
}
if (this.currentInfoWindowType == 'S' || this.currentInfoWindowType == 'R' || (this.currentInfoWindowType == infoWindowType)) {
this.clearInfoWindow();
}
if (infoWindowType != 'S' && infoWindowType != 'R' && this.currentSelectedInfoWindow) {
this.currentSelectedInfoWindow.onRemove();
this.currentSelectedInfoWindow = null;
}
if (!(this.infoWindows[i] && this.infoWindows[i][infoWindowType])) {
if (!this.infoWindows[i]) {
this.infoWindows[i] = {};
}
template = this.getInfoWindow({
local: {
docid: mapData.docid || '',
index: i,
placename: mapData.title,
addr: mapData.addr || '',
phone: mapData.phone || '',
removable: removable || false,
windowType: infoWindowType,
dataType: mapData.type || '',
offset: offset
}
});
infoWindow = new SF.M.customInfoWindow(this.map, mapData.position, template, function(node, point) {
self.renderInfoWindow(node, point, offset, infoWindowType, markerSize,i);
}, SF.C.Place);
this.infoWindows[i][infoWindowType] = infoWindow;
} else {
infoWindow = this.infoWindows[i][infoWindowType];
infoWindow.onAdd();
infoWindow.draw();
}
infoWindow.setMap(this.map);
this.currentInfoWindowType = infoWindowType;
if (infoWindowType != 'S' && infoWindowType != 'R') {
this.currentSelectedInfoWindow = infoWindow;
this.selectedMarkerIdx = i;
} else {
this.currentInfoWindow = infoWindow;
}
this.currentIdx = i;
if (isChangeCenter) {
this.map.panTo(mapData.position);
}
},
removeMapDataInfoWindows: function() {
if (!this.infoWindows) {
return;
}
while (this.infoWindows.length > 0) {
this.infoWindows.splice(0, 1);
}
},
/**
* 인포윈도우가 지도 화면 내에 나타나도록 패닝한다.
* @param {SF.M.customMapMarker} layer customized infoWindow
*/
panIntoView: function(layer, markerSize) {
var map = this.map;
var node = this.mapElem; /* map이 그려지는 division */
/* getBoundingClientRect() 메소드를 지원하지 않는 브라우저에서는 포기 */
if (!node.getBoundingClientRect) {
return;
}
var mapRect = node.getBoundingClientRect();
var selfRect = layer.node_.getBoundingClientRect();
var x = layer.node_.offsetWidth;
var y = layer.node_.offsetHeight;
/* 아래 상수값들은 적절히 조정할 것 */
if (selfRect.right > mapRect.right) {
layer.node_.style.left = parseInt(layer.node_.style.left) - x - markerSize[0] - 5 + 'px';
}
},
panIntoViewxxOnclickRecommend: function(layer) {
var map = this.map;
var node = this.mapElem; /* map이 그려지는 division */
/* getBoundingClientRect() 메소드를 지원하지 않는 브라우저에서는 포기 */
if (!node.getBoundingClientRect) {
return;
}
var mapRect = node.getBoundingClientRect();
var selfRect = layer.node_.getBoundingClientRect();
var dx = 0;
/* 아래 상수값들은 적절히 조정할 것 */
if (selfRect.left < mapRect.left + 40) {
dx = selfRect.left - mapRect.left - 10;
} else if (selfRect.right > mapRect.right - 40) {
dx = selfRect.right - mapRect.right + 10;
}
var dy = 0;
if (selfRect.top < mapRect.top + 50) {
dy = selfRect.top - mapRect.top - 10;
} else if (selfRect.bottom > mapRect.bottom - 60) {
dy = selfRect.bottom - mapRect.bottom + 10;
}
if (dx || dy) {
map.panBy(dx, dy);
}
},
/**
* 결과 목록에서 마커, 장소명에 mouseover/out시에
* 해당 infowindow를 지도에 출력/삭제하는 핸들러
* mouseover 핸들러 실행 도중에 mouseout 이벤트가 발생해도
* mouseout 핸들러의 실행을 mouseover 핸들러의 실행 이후로 미루기 위해 setTimeout을 사용함
* @function
* @param event Object 이벤트 객체
* @param i Number 해당 데이터의 index (zero base)
* @param isShow Boolean infowWindow 출력 여부
*/
toggleInfoWindow: function(eventType, i, isShow) {
var self = this;
if (isShow) {
self.resetMarker(i);
(eventType == 'click') ? self.resetInfoWindow('click', i, true, true): self.resetInfoWindow('mouseover', i, false, false);
} else {
this.clearInfoWindow();
this.clearMarker();
}
},
/**
* 섹션의 자동차, 대중교통 링크 이동을 위한 데이터 추가
*/
addFindRouteContext: function(obj) {
if (!obj) {
return;
}
this.findRouteContext = obj;
},
/**
* 지역 코드 기반으로 지도의 bound를 변경한다.
* @param {String} regionCode 지역 코드
*/
updateMapBoundsByRegionCode: function(regionCode) {
if (!regionCode) {
return;
}
this.clearSelectedInfoWindow();
var bounds = new daum.maps.CoordsBounds();
var firstResultIndex = -1;
for (var i = 0, l = this.mapData.length; i < l; i++) {
var data = this.mapData[i];
if (typeof data.regionCode != 'undefined' && (data.regionCode.indexOf(regionCode) > -1)) {
bounds.extend(data.position);
if (firstResultIndex < 0) {
firstResultIndex = i;
}
}
}
this.map.setBounds(bounds, 0);
this.renderWellKnownPoints(firstResultIndex);
this.currentRegionCode = regionCode;
},
/**
* mouseenter/leave를 구현한다.
* SVG의 경우에 svg object의 node 프로퍼티로 변경 필요함
*/
[안내]태그제한으로등록되지않습니다-onMouseEnter: function(fn) {
var isChildOf = function(parentElem, childElem) {
if(parentElem === childElem) {
return false;
}
try {
while(childElem && childElem !== parentElem) {
childElem = childElem.parentNode;
}
} catch(e) {
return false;
}
return childElem === parentElem;
};
return function(e) {
var elem = e.relatedTarget;
var self = this.node || this;
if(self === elem || isChildOf(self, elem)) {
return;
}
fn.call(self, e);
}
},
/**
* 좌표 정보를 문자열화해서 객체에 담아 리턴한다.
* @return {Object} lat: 위도, lng: 경도
*/
getMapCoords: function(point) {
if (point == '') {
return '';
}
var points = {},
point = point.toString();
point = point.replace('(', '');
point = point.replace(')', '');
points = point.split(',');
return {
lat: parseInt(points[0]),
lng: parseInt(points[1])
}
},
removeMapData: function() {
if (!this.mapData) {
return;
}
while (this.mapData.length > 0) {
this.mapData.splice(0, 1);
}
},
toggleSameNames: function(elem) {
var wrapElem = daum.$$('.wrap_overlap', this.elem);
if (elem && wrapElem[0]) {
if (daum.Element.hasClassName(wrapElem[0], 'extend')) {
daum.Element.removeClassName(wrapElem[0], 'extend');
daum.Element.replaceClassName(elem, 'open', 'close');
elem.innerHTML = '전체보기';
} else {
daum.Element.addClassName(wrapElem[0], 'extend');
daum.Element.replaceClassName(elem, 'close', 'open');
elem.innerHTML = '접기';
}
}
},
/**
* 해당 인덱스의 region code가 첫 번째 결과의 region code와 같은지 여부를 반환한다.
* 즉, 같은 지역에 있는지를 알 수 있다.
* @param {Number} index mapData의 index
* @return {Boolean} 같은 지역인지 여부
*/
isSameRegionWithFirstResult: function(index) {
if (!this.currentRegionCode) {
this.currentRegionCode = this.getRegionCode(0);
}
return (this.currentRegionCode === this.getRegionCode(index)) ? true : false;
},
/**
* 해당 인덱스의 region code를 반환한다.
* @param {Number} index mapData의 index
* @return {String} code 해당 인덱스의 region code
*/
getRegionCode: function(index) {
var code = '';
if (this.mapData.length > 0) {
var codes = this.mapData[index].regionCode.split(' ');
code = ( this.minimapDepth == 1 ) ? codes[0] : codes[1];
}
return code;
},
renderOriginalMap: function() {
this.mergeMapData(this.originalMapData);
this.removeMarkers();
this.removeMarkerImages();
this.currentRegionCode='';
/* 활성화된 인포윈도우 비활성화(비노출) */
this.clearInfoWindow();
this.clearSelectedInfoWindow();
if (this.currentCenter != null ) {
this.render(this.currentCenter);
}
else {
this.render();
}
},
/**
* 배열 삭제. 체크 필수
*/
removeMarkerImages: function() {
if (this.markerImages.length > 0 ) {
this.markerImages = [];
}
},
/**
* 추천 지역 데이터를 제외한 mapData를 업데이트한다.
*/
mergeMapData: function(data, dataLength) {
var i = 0,
l = (dataLength) ? dataLength : this.originalMapData.length;
for (var j = 0; j < l; j++) {
this.mapData[i++] = data[j];
}
this.mapData.length = i;
},
/**
* 지도 상의 마커를 제거한다.
* index 매개변수가 있으면 해당 마커만 삭제하고,
* index 매개변수가 없으면 전체 마커를 삭제한다.
*
* @param {Number} index 삭제할 마커의 인덱스
*/
removeMarkers: function() {
if (!this.markers) {
return;
}
while (this.markers.length > 0) {
this.markers[0].setMap(null);
this.markers.splice(0, 1);
}
},
/**
* LOCALTYPE == 'area'인 경우 지도 섹션으로 '더보기' 링크를 생성한다.
* 지도의 레벨 값을 queryString에 추가하여 새 창을 생성한다.
*
* @param {String} url 프리마커 템플릿에서 생성한 기본 url
* @param {Boolean} hasIpLocation urlLevel 쿼리 스트링을 추가할지 여부
*/
linkToLocal: function(url, hasIpLocation) {
if (!url) {
return;
}
if (hasIpLocation === 'true') {
url += '&urlLevel=' + (this.map.getLevel() - 1 || 5);
}
var win = window.open(url, 'MapBrowser');
win.focus();
},
/**
* 지도 상의 마커를 제거한다.
* @param {Number} index 삭제할 마커의 인덱스
*/
removeMarkerByIndex: function(index) {
if (!index || !this.markers[index]) {
return;
}
this.markers[index].setMap(null);
},
/*
* b태그 제거 및 말줄임
*/
cutString: function(str, length, suffix) {
/* b태그 제거 */
if (str && str.indexOf("") > -1 ) {
str = daum.String.replaceAll(str, "", "");
str = daum.String.replaceAll(str, "", "");
}
return daum.String.cutString(str, length, suffix);
},
getWeatherInfo: function(address) {
try {
var uk = daum.getCookie('uvkey') || null;
if (uk != null ) {
new daum.ajax({
url: './qsearch',
paramString: 'w=weather&q='+ encodeURI(address.api) +'&viewtype=json&qsearch_ver=v2&apikey=ce7ac38aa56e281bde58b6c9b1730adf&uk='+uk,
onsuccess: function (result) {
try {
var resultObject = eval ("(" + result.responseText + ")");
var weatherInfoArr = [];
var count = parseInt(resultObject.RESULT.WEATHER.channel.now.count);
if (count > 0) {
weatherInfoArr = resultObject.RESULT.WEATHER.channel.now.item;
SF.C.Place.renderWeather(weatherInfoArr[0], address);
}
}
catch (e) {}
},
onfailure: function (r) {}
}).request();
}
}
catch(e) {
}
},
renderWeather: function(weather, address) {
try {
var time = { year: weather.ddate.substring(0,4), month: weather.ddate.substring(5,7), day: weather.ddate.substring(8,10), hour: weather.announce.substring(11,13) };
weather.title = time.year + "년 " + time.month + "월 " + time.day + "일 " + time.hour + "시 예보 " + weather.wtext5s;
weather.linkURL = "?w=tot&q=" + encodeURI(address.link) +"&rtmaxcoll=Z8T";
weather.docid = address.docid;
weather.temp = Math.ceil(parseFloat(weather.temp));
weather = {weather: weather};
var elemStr = SF.M.tmpl('localWeatherIcon',weather );
var elem = document.createElement('div');
elem.innerHTML = elemStr;
elem = elem.children[0];
var parentElem = daum.$$('.list_local')[0];
parentElem.insertBefore(elem, parentElem.children[0].nextSibling);
}
catch(e) {}
},
isVacationCategory: function(categoryIdDisp) {
try {
var cateArr = categoryIdDisp.split(' ');
if (cateArr != null && cateArr.length >= 2) {
if ((cateArr[0] == "11" && cateArr[1] == "121") || (cateArr[0] == "10" && cateArr[1] == "155" && cateArr[2] == "3332")){
return true;
}
}
return false;
}
catch(e) {
return false;
}
},
getAddressForWeather: function (addressDisp, docid) {
var address = {};
try {
var addressArr = addressDisp.split("|");
address.api = addressArr[0].trim() + addressArr[1].trim() + addressArr[2].split(" ")[0].trim()+"날씨";
address.link = addressArr[0].trim() + " " + addressArr[1].trim() + " 날씨";
address.docid = docid;
}
catch(e) {}
finally {
return address;
}
}
};
SF.C.Place.init({
type: 'exact'
});
/* 상세 레이어 하이라이팅 및 상세레이어 펼침 */
(function() {
var localType = "exact";
if (localType != "" && localType == "basic") {
var highlightElemArr = daum.$$('.layer_detail .highlighting');
if (highlightElemArr.length == 1) {
var highlightElem = highlightElemArr[0];
if (highlightElem!=null && highlightElem!=undefined) {
var detailLayerWrapElem = null; /* 상세레이어를 감싸는 (상세버튼포함) 구역 */
var detailLayerElem = null;
detailLayerElem = daum.Element.getParent(highlightElem);
detailLayerWrapElem = daum.Element.getParent(detailLayerElem);
daum.Element.addClassName(detailLayerWrapElem, 'detail_opne');
var countDetail = detailLayerElem.childElementCount;
if (countDetail > 0 ) {
var mapAreaHeight = countDetail * 19 + 19; /* 한 row 당 19px */
var mapArea = daum.$('localCollMapArea');
daum.Element.setHeightByOffset( mapArea, mapAreaHeight );
}
}
}
}
})();
(function(){
var categoryCode = "2 63 18123 610";
var addressDisp = "서울|서초구|서초동|967|";
var docid = "8289312";
if (SF.C.Place.isVacationCategory(categoryCode)) {
var address = SF.C.Place.getAddressForWeather(addressDisp, docid);
if (address.hasOwnProperty('api')) {
SF.C.Place.getWeatherInfo(address);
}
}
})();
(function() {
SF.C.Place.addMapData({
docid: '8289312',
position: new daum.maps.Coords('501143', '1109237'),
title: '대법원',
addr: '서울 서초구 서초대로 219 (서초동 967)',
phone: '02-3480-1100',
regionCode: 'I I1014 I1014 I10140300 I10140300',
type: 'exact',
wellKnowns: '10497643^501699^1110639^서리풀공원^서초구 반포동^2.769354|7877967^500853^1109976^몽마르뜨공원^서초구 반포동^2.732706|14565842^500326^1108521^서리풀공원^서초구 방배동^1.593489|8503889^502526^1108947^장안공원^서초구 서초3동^.7968|21160636^503066^1109247^교대역 3호선^서초구 서초동^.299544|8363645^500072^1110790^서래상상어린이공원^서초구 반포4동^.264584|21160623^501694^1108999^서초역 2호선^서초구 서초동^.26424',
line_data : ''
}, true);
})();
/* 길찾기에 필요한 기본 데이터 from freemarker */
SF.C.Place.addFindRouteContext({
eName: '대법원',
point_wx: '501143',
point_wy: '1109237',
docid: '8289312'
});
SF.C.Place.render();
});
16시간전 | 오마이뉴스 | 미디어다음 불법파견 해결을 위해 현대차가 당사자 직접교섭에 나설 것을 촉구하고 있다. 대법원은 26일 현대차 아산공장 비정규직에 대한 불법파견 인정 판결을 내...
13시간전 | 법률신문 서울시가 등록 취소를 신청했던 인터넷신문 '자주민보'에 대해 대법원이 '폐간' 결정을 확정했다. 그러나 자주민보 측은 대법원 선고 직전 비슷한 성향의 '자주일보'라는 이름의 인터넷신문을...
20시간전 | 오마이뉴스 | 미디어다음 없을 것이다." 자동차부품을 생산하는 창원공단 센트랄(회장 강태룡) 사측이 대법원에서 '무당해고?부당노동행위' 판결을 받았지만, 해고자들을 복직시키...
16시간전 | 뉴시스 | 미디어다음 ↑ 【서울=뉴시스】고승민 기자 = 2일 오전 서울 대법원 중회의실에서 열린 제62차 양형위원회에서 전효숙 양형위원장이 모두발언을 하고 있다. 2015.03....