<div class="codetitle"> <span><a style="CURSOR: pointer" data="85190" class="copybut" id="copybut85190" onclick="doCopy('code85190')"><u>코드 복사</u></a></span> 코드는 다음과 같습니다.</div> <div class="codebody" id="code85190"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>无标题文档</title> <br></head> <br><input type="button" value="test" style="height:500px" /> <br>속도:<input type="text" id="txtSelect" /> <br><iframe name="map" src="baidumap.htm" id="map" style="display:none"></iframe> <br><본문> <br></body> <br></html> <br><script type="text/javascript"> <br>document.getElementById("txtSelect").onfocus=function(){ <br>var windows = document.getElementById("window"); <br>var title = document.getElementById("title"); <br>var layer = document.getElementById("layer"); <br>if(windows==null&&layer==null&&title==null){ <br>var style = document.createElement("style"); <br>style.type="text/css"; <br>document.body.appendChild(스타일); <br>var styleText = "#layer{ 너비:100%; 높이:100%;배경:#000000;위치:절대;z-index:100;왼쪽:0;상단:0;필터:알파(불투명도=40 ) 불투명도:0.4}"; <br>styleText ="#window{위치:절대; z-색인:1000;배경:#ffc;}"; <br>styleText ="#제목{ 배경:#CCFFFF;너비:100%;높이:15%;폰트-크기:2em;폰트-가중치:bold; 텍스트-정렬:왼쪽; 줄 높이:1.5em }" <br>styleText ="#content{ 높이:85%;너비:100%;배경:#CCCCCC}"; <br>styleText ="#frame{ width:100%;height:100%;} #map{ width:100%;height:100%}"; <br>시도해 보세요{ <br>if(typeof style.styleSheet.cssText!="정의되지 않음"){ <br>style.styleSheet.cssText=styleText; <br>} <br>}catch(ex){ <br>style.appendChild(document.createTextNode(styleText)); <br>} <br>var layer = document.createElement("div"); <br>document.body.appendChild(레이어); <br>layer.id="레이어"; <br>var windows = document.createElement("div"); <br>document.body.appendChild(창); <br>windows.id="창"; <br>windows.style.height="400px"; <br>windows.style.width = "600px"; <br>var height =parseInt(windows.style.height); <br>var width =parseInt(windows.style.width); <br>windows.style.top = parsInt(document.documentElement.clientHeight/2-height/2) "px"; <br>windows.style.left = parsInt(document.documentElement.clientWidth/2-width/2) "px"; <br>var title = document.createElement("div"); <br>windows.appendChild(제목); <br>title.id="제목"; <br>title.appendChild(document.createTextNode("点此关闭")); <br>var content = document.createElement("div"); <br>windows.appendChild(content); <br>content.id="content"; <br>var map = document.getElementById("map"); <br>content.appendChild(지도); <br>map.style.display="block"; <br>if(typeof layer.style.opacity!="정의되지 않음"){ <br>layer.style.opacity=0.5; <br>} <br>else if(typeof layer.style.filter!="정의되지 않음"){ <br>layer.style.filter="alpha(opacity=50)"; <br>} <br>} <br>else{ <br>if(typeof layer.style.opacity!="undefine"){ <br>layer.style.opacity=0.5; <br>} <br>else if(typeof layer.style.filter!="정의되지 않음"){ <br>layer.style.filter="alpha(opacity=50)"; <br>} <br>layer.style.zIndex=100; <br>windows.style.zIndex=1000; <br>layer.style.display="블록"; <br>windows.style.display="차단"; <br>} <br>layer.onclick = title.onclick = function(){ <br>windows.style.zIndex=-1000; <br>windows.style.display="없음"; <br>//让层渐隐 <br>var 타이머 = setTimeout(displayLayer,200); <br>function displayLayer(){ <br>if(typeof layer.style.opacity!="undefine"){ <br>varlayers = document.getElementById("layer"); <br>var opacity =parseFloat(layers.style.opacity); <br>불투명도 = 불투명도-0.1; <br>if(opacity>0){ <br>setTimeout(arguments.callee,100); <br>} <br>else if(opacity<0){ <BR>layers.style.zIndex=-100; <BR>clearTimeout(타이머); <BR>} <BR>layers.style.opacity = 불투명도; <BR>} <BR>else if(typeof layer.style.filter!="undefine"){ <BR>varlayer = document.getElementById("layer"); <BR>var filterStyle = 레이어.스타일.필터; <BR>//opacity = parsInt(filterStyle.substring(filterStyle.indexOf("=") 1)); <BR>var opacity =parseInt(filterStyle.match(/d /)); <BR>불투명도 = 불투명도-10; <BR>if(opacity>0){ <br>setTimeout(arguments.callee,100); <br>} <br>else if(opacity<0){ <BR>layers.style.zIndex=-100; <BR>clearTimeout(타이머); <BR>} <BR>layers.style.filter = "alpha(opacity=" opacity ")"; <BR>} <BR>else{ <BR>throw new Error("브라우저 버전이 낮습니다!"); <BR>} <BR>} <BR>document.getElementById("txtSelect").value=frames["map"].document.getElementById("hidden").value; <BR>} <BR>}<BR>window.onunload=function(){ <BR>var windows = document.getElementById("window"); <BR>var title = document.getElementById("title") <BR>var layer = document.getElementById ("layer"); <BR>layer.onclick = windows.onclick=null; //이벤트 바인딩 지우기 <BR>document.body.removeChild(layer) <BR>windows.removeChild(title); .body.removeChild(windows); <BR>} <BR></script> <br><br> </div>바이두 지도의 좌표를 보여주는 페이지입니다<br><br><div class="codetitle"><span><a style="CURSOR: pointer" data="76905" class="copybut" id="copybut76905" onclick="doCopy('code76905')">코드 복사<u></u></a> 코드는 다음과 같습니다.</span></div> <div class="codebody" id="code76905"><html> <br><head> 메타 http-equiv ="Content-Type" content="text ml; charset=utf-8"> <br><title>Baidu 지도</title><script type="text/javascript" src=" http://api.map.baidu.com/api?key=458d39374361da27e548367a735831ba&v=1.0&services=true"></script> <br><link href="/Theme/Default/Admin/reset .css" rel="stylesheet" type="text/css" /> <br><link href="/Theme/Default/Admin/style.css" rel="stylesheet" type="text/css" /> <br></head> <br><div> <br><div style="위치: 절대; 너비: 730px : 590px; 왼쪽: 0; 테두리: 1px 단색 회색;" id="container"> <br></div> <br><input id="text_" class=" textbox200" style="width: 150px" type="text" value="청두" /> <br><input class="button90" type="button" value="Query" onClick="searchByStationName (document.getElementById('text_').value);" /> <br><input type="hidden" id="hidden" value="104.105, 30.624" /> <br></form> ; <br></div> <br></body> <br><script type="text/javascript"> var map = new BMap.Map("container"); >map.centerAndZoom(new BMap.Point(104.105, 30.624), 6); <br>map.addControl(new BMap.NavigationControl()) //Navigation<br>map.addControl(new BMap.ScaleControl()) ; <br>map.addControl(new BMap.OverviewMapControl()); <br>map.addEventListener("click", function (e) { <br>document.getElementById("hidden").value = e.point. lng ", " e.point.lat; <br>}); <br>var localSearch = new BMap.LocalSearch(map, { <br>renderOptions: { <br>pageCapacity: 8, <br>autoViewport: true, <br> selectFirstResult: false <br>} <br>}); <br>localSearch.enableAutoViewport(); <br>function searchByStationName(name) { <br>var 키워드 = name; (searchResult) { <br>var poi = searchResult.getPoi(0); <br>alert(poi.point.lng " " poi.point.lat) <br>document.getElementById("hidden").value = e.point .lng "," e.point.lat; <br>map.centerAndZoom(poi.point, 8) <br>}) <br>localSearch.search(키워드) <br>< /스크립트> <br></html></div>