1、显示地图上所有设备的编号,便于现场维护
This commit is contained in:
parent
267047f3a8
commit
bfcfdb8249
@ -116,30 +116,35 @@
|
|||||||
if(data.status === 0) {
|
if(data.status === 0) {
|
||||||
var i=0;
|
var i=0;
|
||||||
for(; i<data.points.length; i++) {
|
for(; i<data.points.length; i++) {
|
||||||
|
var marker;
|
||||||
if(deviceList[batch_id+i].warning == 2) {
|
if(deviceList[batch_id+i].warning == 2) {
|
||||||
map.addOverlay(new BMapGL.Marker(data.points[i], {
|
marker = new BMapGL.Marker(data.points[i], {
|
||||||
icon: loc_red
|
icon: loc_red
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
else if(deviceList[batch_id+i].warning == 1) {
|
else if(deviceList[batch_id+i].warning == 1) {
|
||||||
map.addOverlay(new BMapGL.Marker(data.points[i], {
|
marker = new BMapGL.Marker(data.points[i], {
|
||||||
icon: loc_orange
|
icon: loc_orange
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
map.addOverlay(new BMapGL.Marker(data.points[i], {
|
marker = new BMapGL.Marker(data.points[i], {
|
||||||
icon: loc_green
|
icon: loc_green
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(deviceList[batch_id+i].warning != 0){
|
// 点标记添加点击事件
|
||||||
|
map.addOverlay(marker);
|
||||||
|
|
||||||
|
|
||||||
|
//if(deviceList[batch_id+i].warning != 0){
|
||||||
var label = new BMapGL.Label(deviceList[batch_id+i].deviceid,
|
var label = new BMapGL.Label(deviceList[batch_id+i].deviceid,
|
||||||
{
|
{
|
||||||
position: data.points[i], // 指定文本标注所在的地理位置
|
position: data.points[i], // 指定文本标注所在的地理位置
|
||||||
offset: new BMapGL.Size(10, 10) // 设置文本偏移量
|
offset: new BMapGL.Size(10, 10) // 设置文本偏移量
|
||||||
}); // 创建文本标注对象
|
}); // 创建文本标注对象
|
||||||
map.addOverlay(label);
|
map.addOverlay(label);
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user