diff --git a/modules/editor/components/naver_map/lang/ko.lang.php b/modules/editor/components/naver_map/lang/ko.lang.php index ff44ec796..e105a03af 100644 --- a/modules/editor/components/naver_map/lang/ko.lang.php +++ b/modules/editor/components/naver_map/lang/ko.lang.php @@ -5,11 +5,13 @@ * @brief 위지윅에디터(editor) 모듈 > 멀티미디어 링크 (naver_map) 컴포넌트의 언어팩 **/ - $lang->navermap = "네이버 지도"; - $lang->search_address = "주소 검색"; - $lang->address_list = "주소 선택"; - $lang->navermap_width = "가로크기"; - $lang->navermap_height = "세로크기"; + $lang->map_title = "네이버 지도 검색"; + $lang->map_width = "가로크기"; + $lang->map_height = "세로크기"; + + // 문구 + $lang->about_address = "예) 분당 정자동, 역삼"; + $lang->about_address_use = "검색창에서 원하는 주소를 검색하신후 출력된 결과물을 선택하시고 [추가] 버튼을 눌러주시면 글에 지도가 추가가 됩니다"; // 에러 메세지들 $lang->msg_not_exists_addr = "검색하려는 대상이 없습니다"; diff --git a/modules/editor/components/naver_map/naver_map.class.php b/modules/editor/components/naver_map/naver_map.class.php index 5cffb7ee8..c7ac5355e 100644 --- a/modules/editor/components/naver_map/naver_map.class.php +++ b/modules/editor/components/naver_map/naver_map.class.php @@ -107,31 +107,45 @@ function displayMap() { $id = "navermap".rand(11111111,99999999); - $width = Context::get('width'); - $height = Context::get('height'); - $x = Context::get('x'); - $y = Context::get('y'); - $html .= - sprintf( + $width = Context::get('width'); + if(!$width) $width = 640; + + $height = Context::get('height'); + if(!$height) $height = 480; + + $x = Context::get('x'); + if(!$x) $x = 321198; + + $y = Context::get('y'); + if(!$y) $y = 529730; + + $html = ''. ''. ''. + ''. ''. ''. - ''. + ''. + ''. ''. ''. - '
'. + '
'. ''. - ''. - '', - $this->open_api_key, $id, $width, $height, $id, $x, $y - ); + 'var mapObj = new NMap(document.getElementById("'.$id.'"));'. + 'mapObj.addControl(new NSaveBtn());'; + + if($x&&$y) $html .= 'mapObj.setCenterAndZoom(new NPoint('.$x.','.$y.'),3);'; + + $html .= 'mapObj.enableWheelZoom();'. + 'NEvent.addListener(mapObj, "click", function(pos) { if(typeof(top.mapClicked)!="undefined") top.mapClicked(pos); });'. + 'NEvent.addListener(mapObj, "mouseup", function(pos) { if(typeof(top.mapClicked)!="undefined") top.mapClicked(pos); });'. + ''. + ''. + ''; + print $html; exit(); } diff --git a/modules/editor/components/naver_map/tpl/popup.css b/modules/editor/components/naver_map/tpl/popup.css index d11bc5525..a7da368fc 100644 --- a/modules/editor/components/naver_map/tpl/popup.css +++ b/modules/editor/components/naver_map/tpl/popup.css @@ -1,5 +1,5 @@ .editor_window { - width:600px; + width:700px; clear:both; } @@ -16,45 +16,91 @@ text-align:center; } -.header { +.address_box { float:left; - width:100px; - clear:left; - text-align:left; - font-weight:bold; + width:250px; + border:1px solid #EEEEEE; + padding:5px; margin:5px; - font-size:9pt; - font-size:9pt; } -.body { - float:left; - width:400px; - text-align:left; - margin:5px; - font-size:9pt; -} -.body label { - cursor:pointer; - font-size:9pt; -} - -.navermap_address { - width:80px; +.input_address { + width:200px; border:1px solid #AAAAAA; height:12px; font-size:9pt; } -.navermap_size { - width:40px; - border:1px solid #AAAAAA; +.address_button { + margin-top:4px; + background-color:#AAAAAA; + border:1px solid #333333; + color:#FFFFFF; + height:16px; + font-size:9pt; +} + +.about_address { + font-size:8pt; + color:#AAAAAA; + margin-top:3px; +} + +.address_list_box { + border:1px solid #DDDDDD; + padding:5px; + float:left; + width:250px; + height:288px; + margin:5px; + font-size:9pt; + color:#AAAAAA; + overflow:auto; +} + +.address_list_box A { + color:#888888; + line-height:15px; +} + +.map_scale_box { + float:left; + width:250px; + border:1px solid #EEEEEE; + padding:5px; + margin:5px; +} + +.map_scale_header { + float:left; + font-size:9pt; + width:60px; +} + +.map_scale_body { + width:180px; + float:left; + margin-left:5px; + font-size:9pt; +} + +.input_map_size { + width:30px; + border:1px solid #EEEEEE; height:12px; font-size:9pt; } +.map_display { + float:right; + width:410px; + height:410px; + margin:5px 5px 0px 6px; +} + .editor_button_area { + width:100%; border-top:1px solid #AAAAAA; text-align:center; background-color:#EEEEEE; diff --git a/modules/editor/components/naver_map/tpl/popup.html b/modules/editor/components/naver_map/tpl/popup.html index c0b39d0d0..b9210fb58 100644 --- a/modules/editor/components/naver_map/tpl/popup.html +++ b/modules/editor/components/naver_map/tpl/popup.html @@ -2,21 +2,28 @@ -
+ + +
-
{$lang->navermap}
+
{$lang->map_title}
-
{$lang->search_address}
-
+
-
{$lang->address_list}
-
+
+ +
{$lang->about_address}
+
-
{$lang->navermap_width}
-
px
+
{$lang->about_address_use}
-
{$lang->navermap_height}
-
px
+
+
{$lang->map_width}
+
px
+ +
{$lang->map_height}
+
px
+
diff --git a/modules/editor/components/naver_map/tpl/popup.js b/modules/editor/components/naver_map/tpl/popup.js index 9c0374467..488af9414 100644 --- a/modules/editor/components/naver_map/tpl/popup.js +++ b/modules/editor/components/naver_map/tpl/popup.js @@ -14,39 +14,35 @@ function getNaverMap() { var width = xWidth(node); var height = xHeight(node); var address = node.getAttribute("address"); - var selected_address = node.getAttribute("selected_address"); - if(!address || !x || !y) return; - xGetElementById("address").value = address; - search_address(selected_address); + if(x&&y) { + xGetElementById("map_x").value = x; + xGetElementById("map_y").value = y; + moveMap(x,y,3); + } + if(address) { + xGetElementById("address").value = address; + search_address(address); + } - xGetElementById("navermap_width").value = width-6; - xGetElementById("navermap_height").value = height-6; + xGetElementById("map_width").value = width-6; + xGetElementById("map_height").value = height-6; } function insertNaverMap(obj) { if(typeof(opener)=="undefined") return; - - var listup_obj = xGetElementById("address_list"); - var idx = listup_obj.options[listup_obj.selectedIndex].value; - if(!idx) { - window.close(); - return; - } - var item = naver_address_list[idx]; - var x = item[0]; - var y = item[1]; - var selected_address = item[2]; + var x = xGetElementById("map_x").value; + var y = xGetElementById("map_y").value; var address = xGetElementById("address").value; - var width = xGetElementById("navermap_width").value; + var width = xGetElementById("map_width").value; if(!width) width = 640; - var height = xGetElementById("navermap_height").value; + var height = xGetElementById("map_height").value; if(!height) height= 480; - var text = "
"; + var text = "
"; opener.editorFocus(opener.editorPrevSrl); @@ -74,6 +70,16 @@ function search_address(selected_address) { exec_xml('editor', 'procCall', params, complete_search_address, response_tags, selected_address); } +function moveMap(x,y,scale) { + if(typeof(scale)=="undefined") scale = 3; + display_map.moveMap(x,y,scale); +} + +function mapClicked(pos) { + xGetElementById("map_x").value = pos.x; + xGetElementById("map_y").value = pos.y; +} + var naver_address_list = new Array(); function complete_search_address(ret_obj, response_tags, selected_address) { var address_list = ret_obj['address_list']; @@ -81,20 +87,15 @@ function complete_search_address(ret_obj, response_tags, selected_address) { naver_address_list = new Array(); - var listup_obj = xGetElementById("address_list"); - var length = listup_obj.options.length; - for(var i=0;i"+item[2]+"
"; } + + var list_zone = xGetElementById("address_list"); + xInnerHtml(list_zone, html); }