HTML
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=秘钥"></script>
<body> <div id="container" style="width: 100%;height:750px;"></div> <script type="text/javascript">
var objdata = new Array(); $.ajax({ url: '/form/query', method: 'POST', data: { city:$("#checkCity").val(), years:$("#checkYear").val() }, success: function (res) { if (res.code == 200) { $.each(res.data, function (key, value) { objdata.push(new BMap.Point(value.lng,value.lat)); }); } } }); var map = new BMap.Map("container"); var point = new BMap.Point(116.12, 24.28); map.centerAndZoom(point, 10); map.enableScrollWheelZoom(); //由于数据太多,需要时间才能把所有数组装进来 setTimeout(function () { co