git-svn-id: http://xe-core.googlecode.com/svn/trunk@593 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-22 01:57:08 +00:00
parent adf1fc2d71
commit c4f9f54d79
5 changed files with 157 additions and 87 deletions

View file

@ -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 = "<div editor_component=\"naver_map\" class=\"editor_component_output\" address=\""+address+"\" selected_address=\""+selected_address+"\" x=\""+x+"\" y=\""+y+"\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;\"></div>";
var text = "<div editor_component=\"naver_map\" class=\"editor_component_output\" address=\""+address+"\" x=\""+x+"\" y=\""+y+"\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;\"></div>";
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<length;i++) listup_obj.remove(0);
var html = "";
var address_list = address_list.split("\n");
for(var i=0;i<address_list.length;i++) {
var item = address_list[i].split(",");
naver_address_list[naver_address_list.length] = item;
var selected = false;
if(selected_address && selected_address == item[2]) selected = true;
var opt = new Option(item[2], naver_address_list.length-1, false, selected);
listup_obj.options[listup_obj.length] = opt;
html += "<a href='#' onclick=\"moveMap('"+item[0]+"','"+item[1]+"');return false;\">"+item[2]+"</a><br />";
}
var list_zone = xGetElementById("address_list");
xInnerHtml(list_zone, html);
}