问题描述
当你在百度地图中搜索某县城的时候,会有一个圈来表示该县城的区域。求该段代码!!!!!我是把百度地图嵌入到网站上的,不知道该如何实现该功能,跪求高手指教!!<p><metacontent="text/html;charset=gb2312"http-equiv="Content-Type"/></p><SCRIPTsrc="http://map.baidu.com/fwmap/upload/r/map/fwmap/bapi.js"type=text/javascript></SCRIPT><SCRIPTsrc="http://api.map.baidu.com/api?key=6b1266e219f7c11d72a1bbe25f43981e&v=1.0&services=false"type=text/javascript></SCRIPT><divstyle="border-bottom:#6661pxsolid;border-left:#6661pxsolid;margin:30pxauto;width:100%;height:400px;border-top:#6661pxsolid;border-right:#6661pxsolid;text-aglin:center"id="container"> </div><SCRIPTlanguage=JavaScript>varmap=newBMap.Map("container");varpoint=newBMap.Point(123.969123,44.926914);map.centerAndZoom(point,13);map.addControl(newBMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_SMALL}));源代码如下,该怎么加!!!!!!!!!!!!!!!1
解决方案
解决方案二:
<%@pagelanguage="java"contentType="text/html;charset=GBK"pageEncoding="GBK"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>本地搜索配置</title><scripttype="text/javascript"src="http://api.map.baidu.com/api?key=46ce9d0614bf7aefe0ba562f8cf87194&v=1.1&services=true"></script></head><bodyonload="load()"><%Stringscname=request.getParameter("scname");if(scname==null){scname="自强西路";}else{scname=newString(scname.getBytes("iso-8859-1"),"gbk");}%><formaction="#"><inputtype="text"name="scname"value="<%=scname%>"id="scname"/><inputtype="submit"value="提交"/></form><divid="info"style="width:800px;height:100px;"></div><divstyle="width:800px;height:400px;border:1pxsolidgray"id="container"></div><divid="results"style="width:800px;height:100px;font-size:13px;margin-top:10px;"></div></body><scripttype="text/javascript">varmap=newBMap.Map("container");map.centerAndZoom(newBMap.Point(123.432791,41.808645),12);map.addEventListener("click",function(e){document.getElementById("info").innerHTML=document.getElementById("info").innerHTML+"<br/>"+e.point.lng+","+e.point.lat;});functionload(){varscname=document.forms[0].scname.value;if(scname!=null&&scname.length>0){varlocal=newBMap.LocalSearch("西安市",{renderOptions:{map:map,panel:"results",autoViewport:true,selectFirstResult:false}});local.search(scname);}}</script></html>
好了给分吧
解决方案三:
您把整段代码都给我呗,我要划得“乾安县”得区域,您的代码有点看不懂。谢谢!!!