优化首页
This commit is contained in:
parent
71e4ad3c3c
commit
9c98c171ec
@ -33,7 +33,7 @@
|
|||||||
<div class="layuimini-main">
|
<div class="layuimini-main">
|
||||||
|
|
||||||
<div class="layui-row layui-col-space30">
|
<div class="layui-row layui-col-space30">
|
||||||
<div class="layui-col-md6">
|
<div class="layui-col-xs12 layui-col-md6">
|
||||||
<div class="layui-card top-panel">
|
<div class="layui-card top-panel">
|
||||||
<div class="layui-card-header">设备数量</div>
|
<div class="layui-card-header">设备数量</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
@ -49,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-md6">
|
<div class="layui-col-xs12 layui-col-md6">
|
||||||
<div class="layui-card top-panel">
|
<div class="layui-card top-panel">
|
||||||
<div class="layui-card-header">告警统计</div>
|
<div class="layui-card-header">告警统计</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
@ -80,8 +80,10 @@
|
|||||||
function initialize() {
|
function initialize() {
|
||||||
var map = new BMapGL.Map("map-container"); // 创建Map实例
|
var map = new BMapGL.Map("map-container"); // 创建Map实例
|
||||||
var point = new BMapGL.Point(116.404, 39.915);
|
var point = new BMapGL.Point(116.404, 39.915);
|
||||||
map.centerAndZoom(point, 6);
|
map.centerAndZoom(point, 7);
|
||||||
map.enableScrollWheelZoom(true);
|
map.enableScrollWheelZoom(true);
|
||||||
|
var centerLat = 0;
|
||||||
|
var centerLon = 0;
|
||||||
var deviceList=
|
var deviceList=
|
||||||
[
|
[
|
||||||
[# th:each="device : ${deviceList}"]
|
[# th:each="device : ${deviceList}"]
|
||||||
@ -91,12 +93,15 @@
|
|||||||
[/]
|
[/]
|
||||||
];
|
];
|
||||||
//console.log(deviceList);
|
//console.log(deviceList);
|
||||||
/*var i=0;
|
for(var i=0; i<deviceList.length; i++) {
|
||||||
for(; i<deviceList.length; i++) {
|
centerLat += deviceList[i].latitude;
|
||||||
point = new BMapGL.Point(deviceList[i].longitude, deviceList[i].latitude);
|
centerLon += deviceList[i].longitude;
|
||||||
map.addOverlay(new BMapGL.Marker(point));
|
}
|
||||||
|
if(deviceList.length>0) {
|
||||||
|
centerLat = centerLat/deviceList.length;
|
||||||
|
centerLon = centerLon/deviceList.length;
|
||||||
|
map.setCenter(new BMapGL.Point(centerLon,centerLat));
|
||||||
}
|
}
|
||||||
if(i>0) map.setCenter(point);*/
|
|
||||||
|
|
||||||
translateCallback = function (data){
|
translateCallback = function (data){
|
||||||
if(data.status === 0) {
|
if(data.status === 0) {
|
||||||
@ -104,7 +109,6 @@
|
|||||||
for(; i<data.points.length; i++) {
|
for(; i<data.points.length; i++) {
|
||||||
map.addOverlay(new BMapGL.Marker(data.points[i]));
|
map.addOverlay(new BMapGL.Marker(data.points[i]));
|
||||||
}
|
}
|
||||||
if(i>0) map.setCenter(data.points[i-1]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user