@@ -80,8 +80,10 @@
function initialize() {
var map = new BMapGL.Map("map-container"); // 创建Map实例
var point = new BMapGL.Point(116.404, 39.915);
- map.centerAndZoom(point, 6);
+ map.centerAndZoom(point, 7);
map.enableScrollWheelZoom(true);
+ var centerLat = 0;
+ var centerLon = 0;
var deviceList=
[
[# th:each="device : ${deviceList}"]
@@ -91,12 +93,15 @@
[/]
];
//console.log(deviceList);
- /*var i=0;
- for(; i0) {
+ centerLat = centerLat/deviceList.length;
+ centerLon = centerLon/deviceList.length;
+ map.setCenter(new BMapGL.Point(centerLon,centerLat));
}
- if(i>0) map.setCenter(point);*/
translateCallback = function (data){
if(data.status === 0) {
@@ -104,7 +109,6 @@
for(; i0) map.setCenter(data.points[i-1]);
}
}