优化首页

This commit is contained in:
weidong 2024-02-04 00:04:49 +08:00
parent 71e4ad3c3c
commit 9c98c171ec

View File

@ -33,7 +33,7 @@
<div class="layuimini-main">
<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-header">设备数量</div>
<div class="layui-card-body">
@ -49,7 +49,7 @@
</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-header">告警统计</div>
<div class="layui-card-body">
@ -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(; i<deviceList.length; i++) {
point = new BMapGL.Point(deviceList[i].longitude, deviceList[i].latitude);
map.addOverlay(new BMapGL.Marker(point));
for(var i=0; i<deviceList.length; i++) {
centerLat += deviceList[i].latitude;
centerLon += deviceList[i].longitude;
}
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){
if(data.status === 0) {
@ -104,7 +109,6 @@
for(; i<data.points.length; i++) {
map.addOverlay(new BMapGL.Marker(data.points[i]));
}
if(i>0) map.setCenter(data.points[i-1]);
}
}