百度地图根据城市名称获取中心坐标

<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;}
#l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
#r-result{height:100%;width:20%;float:left;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=9b0cf02037cc6caab5325dbd1539ff02"></script>
<title>根据城市名称获取坐标点</title>
</head>
<body>
<div id="l-map"></div>
<div id="r-result"></div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/L_Taozi/article/details/88298369