네이버 지도 수정 - 검색 결과 클릭시 지도 화면에 위치 설명이 2초간 뜨게 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5795 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-03-08 03:46:16 +00:00
parent 16271673e0
commit a2dc654a83
2 changed files with 21 additions and 6 deletions

View file

@ -151,14 +151,18 @@
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'.
'<script type="text/javascript" src="./common/js/x.js"></script>'.
'<script type="text/javascript" src="http://maps.naver.com/js/naverMap.naver?key='.$this->api_key.'"></script>'.
'<script type="text/javascript">'.
'<script type="text/javascript">'."\n".
'//<!--'."\n".
'function moveMap(x,y,scale) { mapObj.setCenterAndZoom(new NPoint(x,y),scale); }'.
'function showInfo(x,y,content) { infowin.hideWindow(); infowin = new NInfoWindow(); infowin.set(new NPoint(x,y), \'<div style="background-color:#FFFFFF;"><strong>\'+content+\'</strong></div>\'); infowin.setOpacity(0.6); mapObj.addOverlay(infowin); infowin.showWindow(); infowin.delayHideWindow(2000); }'.
'function createMarker(pos) { if(typeof(top.addMarker)=="function") { if(!top.addMarker(pos)) return; var iconUrl = "http://static.naver.com/local/map_img/set/icos_free_"+String.fromCharCode(96+top.marker_count-1)+".gif"; var marker = new NMark(pos,new NIcon(iconUrl,new NSize(15,14))); mapObj.addOverlay(marker); } }'.
"\n".'//-->'."\n".
'</script>'.
'</head>'.
'<body style="margin:0px;">'.
'<div id="'.$id.'" style="width:'.$width.'px;height:'.$height.'px;"></div>'.
'<script type="text/javascript">'.
'//<!--'."\n".
'var mapObj = new NMap(document.getElementById("'.$id.'"));'.
'mapObj.addControl(new NSaveBtn());'.
'var zoom = new NZoomControl();'.
@ -190,6 +194,7 @@
$html .= ''.
//'mapObj.enableWheelZoom();'.
"\n".'//-->'."\n".
'</script>'.
'</body>'.
'</html>';

View file

@ -76,7 +76,13 @@ function moveMap(x,y,scale) {
display_map.moveMap(x,y,scale);
}
function selectPoint(i) {
moveMap(item[i][0],item[i][1],3);
display_map.showInfo(item[i][0],item[i][1],item[i][2]);
}
var naver_address_list = new Array();
var item = new Array();
function complete_search_address(ret_obj, response_tags, selected_address) {
var address_list = ret_obj['address_list'];
if(!address_list) return;
@ -85,14 +91,18 @@ function complete_search_address(ret_obj, response_tags, selected_address) {
var html = "";
var address_list = address_list.split("\n");
for(var i=0;i<address_list.length;i++) {
var item = address_list[i].split(",");
if(address_list.length) {
item = new Array();
for(var i=0;i<address_list.length;i++) {
item[i] = new Array();
item[i] = address_list[i].split(",");
naver_address_list[naver_address_list.length] = item;
html += "<li class=\"address_lists\"><a href='#' onclick=\"moveMap('"+item[0]+"','"+item[1]+"');return false;\">"+item[2]+"</a></li>";
naver_address_list[naver_address_list.length] = item;
html += "<li class=\"address_lists\"><a href='#' onclick=\"selectPoint("+i+");return false;\">"+item[i][2]+"</a></li>";
}
}
if(address_list.length == 1) {
moveMap(item[0],item[1]);
selectPoint(0);
}
var list_zone = xGetElementById("address_list");