标题:
百度地图画出区域并获取区域坐标范围(1)
[打印本页]
作者:
look_w
时间:
2019-4-20 11:24
标题:
百度地图画出区域并获取区域坐标范围(1)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
body, html{width: 100%;height: 100%;overflow: hidden;margin:0;}
#allmap {margin-right: 300px;height: 100%;overflow: hidden;}
#result {border-left:1px dotted #999;height:100%;width:295px;position:absolute;top:0px;right:0px;font-size:12px;}
dl,dt,dd,ul,li{
margin:0;
padding:0;
list-style:none;
}
p{font-size:12px;}
dt{
font-size:14px;
font-family:"微软雅黑";
font-weight:bold;
border-bottom:1px dotted #000;
padding:5px 0 5px 5px;
margin:5px 0;
}
dd{
padding:5px 0 0 5px;
}
li{
line-height:28px;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=百度地图密钥"></script>
<!--加载鼠标绘制工具-->
<script type="text/javascript" src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
<link rel="stylesheet" href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css" />
<!--加载检索信息窗口-->
<script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
<link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.css" />
<title>鼠标绘制工具</title>
</head>
<body>
<div id="allmap" style="overflow:hidden;zoom:1;position:relative;">
<div id="map" style="height:100%;-webkit-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;"></div>
<div id="showPanelBtn" style="position:absolute;font-size:14px;top:50%;margin-top:-95px;right:0px;width:20px;padding:10px 10px;color:#999;cursor:pointer;text-align:center;height:170px;background:rgba(255,255,255,0.9);-webkit-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;font-family:'微软雅黑';font-weight:bold;">显示检索结果面板<br/><</div>
<div id="panelWrap" style="width:0px;position:absolute;top:0px;right:0px;height:100%;overflow:auto;-webkit-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;">
<div style="width:20px;height:200px;margin:-100px 0 0 -10px;color:#999;position:absolute;opacity:0.5;top:50%;left:50%;" id="showOverlayInfo">此处用于展示覆盖物信息</div>
<div id="panel" style="position:absolute;"></div>
</div>
</div>
<div id="result">
<dl>
<dt>绘制工具功能</dt>
<ul>
<li><label><input type="radio" name="openClose1"/>打开</label> <label><input type="radio" name="openClose1" checked="checked"/>关闭</label></li>
</ul>
</dd>
<dt>是否进行线或面积的计算(单位米)</dt>
<ul>
<li><label><input type="radio" name="openClose"/>打开</label> <label><input type="radio" name="openClose" checked="checked"/>关闭</label></li>
</ul>
</dd>
<dt>绘制功能</dt>
<dd>
<ul>
<li>
<label><input type="radio" name="drawmode" checked="checked"/>画点</label>
<input type="checkbox" id="isInfowindow"/> 是否带信息窗口
</li>
<li>
<label><input type="radio" name="drawmode"/>画圆</label>
</li>
<li>
<label><input type="radio" name="drawmode"/>画线</label>
</li>
<li>
<label><input type="radio" name="drawmode"/>画多边形</label>
</li>
<li>
<label><input type="radio" name="drawmode"/>画矩形</label>
</li>
</ul>
</dd>
<dt>覆盖物操作</dt>
<dd>
<ul>
<li>
<input type="button" value="获取绘制的覆盖物个数"/>
<input type="button" value="清除所有覆盖物"/>
<input type="button" value="获取最后一个覆盖物信息" id="getLastOverLay"/>
</li>
</ul>
</dd>
</dl>
</div>
<script type="text/javascript">
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0