The device is labeled on the map
function Getgateinfo (VSID, VMap) {
var icon = ".. /content/easyui/themes/icons/gate.png ";
var Myicon = new Bmap.icon (Icon, New Bmap.size (32, 32), {
Offset:new Bmap.size (32, 32)
});
$.ajax ({
Type: "Post",
URL: "/monitormanage/getstationgate?" Sid= "+ VSID,
Success:function (obj) {
for (var i = 0; i < obj.length; i++) {
var Vgateid = Obj[i]. Gateid;
var vgatename = Obj[i]. Gatename;
var vlongitude = Obj[i]. longitude;
var vlatitude = Obj[i]. Latitude;
var point = new Bmap.point (Obj[i]. Longitude, Obj[i]. Latitude); POI Point coordinates
var marker = new Bmap.marker (point, {icon:myicon});
Vmap.addoverlay (marker);
(function (x) {
var point = new Bmap.point (Obj[x]. Longitude, obj[x]. Latitude); Create point coordinates
alert (point);
var marker = new Bmap.marker (Point,{icon:myicon});
Create an Information window object, in which you can write any HTML statement in quotation marks.
var Infowindow = new Bmap.infowindow
("<table class= ' mytable ' border= ' 0 ' cellspacing= ' 0 ' cellpadding= ' 0 ' >"
+ "<tr><td> Site name:" + obj[x]. Gatename
+ "</td></tr><tr><td> Longitude:" + obj[x]. Longitude
+ "</td></tr><tr><td> Latitude:" + obj[x]. Latitude
+ "</td></tr></table>");
Move the mouse over the callout point to happen
Marker.addeventlistener ("MouseOver", function () {
This.openinfowindow (Infowindow);
});
Move the cursor away from the callout point what's going to happen
Marker.addeventlistener ("Mouseout", function () {
This.closeinfowindow (Infowindow);
});
Vmap.addoverlay (marker);
}) (i);
Create an Information window object, in which you can write any HTML statement in quotation marks.
var Infowindow = new Bmap.infowindow
("<table class= ' mytable ' border= ' 0 ' cellspacing= ' 0 ' cellpadding= ' 0 ' >"
+ "<tr><td> Site name:" + vgatename
+ "</td></tr><tr><td> Longitude:" + vlongitude
+ "</td></tr><tr><td> Latitude:" + vlatitude
+ "</td></tr></table>");
Move the mouse over the callout point to happen
Marker.addeventlistener ("MouseOver", function () {
This.openinfowindow (Infowindow,point);
//});
Move the cursor away from the callout point what's going to happen
Marker.addeventlistener ("Mouseout", function () {
This.closeinfowindow (Infowindow, point);
//});
}
}
})
}
Baidu map Loop to add labels, and loop for the mouse hover labels when the information window problem resolution