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>