<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>varlayer = 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(style); <br>var styleText = "#layer{ width:100%;height:100%;background:#000000;position:absolute;z-index:100;left:0;top:0;filter:alpha(opacity=40 ); 不透明度:0.4}"; <br>styleText ="#window{position:absolute; z-index:1000;background:#ffc;}"; <br>styleText ="#title{ background:#CCFFFF;width:100%;height:15%;font-size:2em;font-weight:bold; text-align:left; line-height:1.5em }" <br>styleText ="#content{ 高さ:85%;幅:100%;背景:#CCCCCC}"; <br>styleText ="#frame{ 幅:100%;高さ:100%;} #map{ 幅:100%;高さ: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>varlayer = document.createElement("div"); <br>document.body.appendChild(layer); <br>layer.id="レイヤー"; <br>var windows = document.createElement("div"); <br>document.body.appendChild(windows); <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 = parseInt(document.documentElement.clientHeight/2-height/2) "px"; <br>windows.style.left = parseInt(document.documentElement.clientWidth/2-width/2) "px"; <br>var title = document.createElement("div"); <br>windows.appendChild(title); <br>title.id="タイトル"; <br>title.appendChild(document.createTextNode("点此关闭")); <br>var content = document.createElement("div"); <br>windows.appendChild(コンテンツ); <br>content.id="コンテンツ"; <br>var map = document.getElementById("map"); <br>content.appendChild(map); <br>map.style.display="ブロック"; <br>if(typeoflayer.style.opacity!="unknown"){ <br>layer.style.opacity=0.5; <br>} <br>else if(typeoflayer.style.filter!="未定義"){ <br>layer.style.filter="alpha(opacity=50)"; <br>} <br>} <br>else{ <br>if(typeoflayer.style.opacity!="unknown"){ <br>layer.style.opacity=0.5; <br>} <br>else if(typeoflayer.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="none"; <br>//让层渐隐 <br>var timer = setTimeout(displayLayer,200); <br>function displayLayer(){ <br>if(typeoflayer.style.opacity!="unknown"){ <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(opacitylayers.style.zIndex=-100; <br>clearTimeout(タイマー); <br>} <br>layers.style.opacity = 不透明度; <br>} <br>else if(typeoflayer.style.filter!="unknown"){ <br>varlayers = document.getElementById("layer"); <br>var filterStyle =layers.style.filter; <br>//opacity = parseInt(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(opacitylayers.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(title); .body.removeChild(windows); <br>} <br></script> <br><br> <br>これは百度地図の座標を示すページです</div> <br><br><div class="codetitle"> <span>コードをコピーします<a style="CURSOR: pointer" data="76905" class="copybut" id="copybut76905" onclick="doCopy('code76905')"><u></u><html> </a><head< meta http-equiv ="Content-Type" content="text ml; charset=utf-8"> </span><title>Baidu Map</title> </div><script type="text/javascript" src=" http://api.map.baidu.com/api?key=458d39374361da27e548367a735831ba&v=1.0&services=true"></script><div class="codebody" id="code76905"><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; : 590 ピクセル; 左: 0; 境界: 1 ピクセル ソリッド グレー;" id="コンテナ"> <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><script type="text/javascript"> <br>varmap("コンテナ"); >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>localSearch.search(キーワード); ></script><br></html></div>