| | |
| | | icon["width"] = 50; |
| | | icon["height"] = 50; |
| | | option["icon"] = icon; |
| | | var moralMask = new moralMap.MoralMarker(option); |
| | | var moralMarker = new moralMap.MoralMarker(option); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | //==================infoWindow-start============================ |
| | | var infoWindow = (function() { |
| | |
| | | } |
| | | return new BMap.InfoWindow(getAdressOutHtml(), winOpts); |
| | | })(); |
| | | if(moralMask["infoWindow"] == undefined) { |
| | | moralMask["infoWindow"] = infoWindow; |
| | | if(moralMarker["infoWindow"] == undefined) { |
| | | moralMarker["infoWindow"] = infoWindow; |
| | | } |
| | | //弹窗打开和关闭 |
| | | moralMask.addEventListener("mouseover", function() { |
| | | moralMarker.addEventListener("mouseover", function() { |
| | | moralMap.openInfoWindow(infoWindow, this._point); //开启信息窗口 |
| | | }); |
| | | moralMask.addEventListener("mouseout", function() { |
| | | moralMarker.addEventListener("mouseout", function() { |
| | | moralMap.closeInfoWindow(); |
| | | }); |
| | | //==================infoWindow-end============================ |
| | | //储存监控点 |
| | | moralMap.putMpoint(option['id'], moralMask); |
| | | return moralMask; |
| | | moralMap.putMpoint(option['id'], moralMarker); |
| | | return moralMarker; |
| | | } |
| | | //储存MonitorPoint对象 |
| | | moralMap.putMpoint = function(key, obj) { |
| | |
| | | option["offline_height"] = 80; |
| | | option["online_width"] = 355; |
| | | option["online_height"] = 385; |
| | | var moralMask = new moralMap.MoralMarker(option); |
| | | var moralMarker = new moralMap.MoralMarker(option); |
| | | // var mark =new BMap.Marker(pointObj,{icon:iconObj}); |
| | | //==================infoWindow-start============================ |
| | | var infoWindow = (function() { |
| | |
| | | } |
| | | }; |
| | | |
| | | if(moralMask["infoWindow"] == undefined) { |
| | | moralMask["infoWindow"] = infoWindow; |
| | | if(moralMarker["infoWindow"] == undefined) { |
| | | moralMarker["infoWindow"] = infoWindow; |
| | | } |
| | | var mouseOverHandle = option['mouseover']; |
| | | //弹窗打开和关闭 |
| | | moralMask.addEventListener("mouseover", function() { |
| | | moralMarker.addEventListener("mouseover", function() { |
| | | if(mouseOverHandle!=null&&mouseOverHandle instanceof Function){ |
| | | //将arguments转换成数组 |
| | | var args = Array.prototype.slice.call(arguments); |
| | |
| | | infoWindow.redraw(); |
| | | } |
| | | }); |
| | | moralMask.addEventListener("mouseout", function() { |
| | | moralMarker.addEventListener("mouseout", function() { |
| | | baiduMap.closeInfoWindow(); |
| | | infoWindow.setContent(""); |
| | | moralMap.openSearchBox(); |
| | | }); |
| | | //==================infoWindow-end============================ |
| | | //储存监控点 |
| | | moralMap.putEquipment(option['mac'], moralMask); |
| | | var _super_refreshState = moralMask.refreshState; |
| | | return $.extend(moralMask, { |
| | | moralMap.putEquipment(option['mac'], moralMarker); |
| | | var _super_refreshState = moralMarker.refreshState; |
| | | return $.extend(moralMarker, { |
| | | refreshState: function(data) { |
| | | if(data != null && data!="") { |
| | | var state = this.getOption()["state"]; |