ak=N4ubwRGOKbrtFK41OIAjV8X4,别用我的,後果自負
擷取坐标點
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>行政區域工具 擷取坐标點</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
</head>
<body>
<div style="width:520px;height:340px;border:1px solid gray" id="container"></div>
<p><input id="startBtn" type="button" οnclick="startTool();" value="開啟取點工具" /><input type="button" οnclick="map.clearOverlays();document.getElementById('info').innerHTML = '';points=[];" value="清除" /></p>
<div id="info"></div>
</body>
</html>
2 隻是以坐标點為中心 沒有文字說明 需要擷取百度地圖的ak
<!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,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微軟雅黑";}
</style>
<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=在這裡輸入ak"></script>
<title>沒有顯示坐标點,隻是在正中間</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
3 還可以需要擷取百度地圖的ak
<!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%;margin:0;font-family:"微軟雅黑";}
#allmap{height:500px;width:100%;}
#r-result{width:100%;}
</style>
<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=在這裡輸入ak"></script>
<title>添加/删除覆寫物</title>
</head>
<body>
<div id="allmap"></div>
<div id="r-result">
<input type="button" οnclick="add_overlay();" value="添加覆寫物" />
<input type="button" οnclick="remove_overlay();" value="删除覆寫物" />
</div>
</body>
</html>