real.html
4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<link href="/pages/mapmonitor/real/css/real.css" rel="stylesheet" type="text/css" />
<!-- 百度路况控件 style -->
<link href="/assets/css/TrafficControl.css" rel="stylesheet" type="text/css" />
<!-- css3 动画库 -->
<link href="/metronic_v4.5.4/css/animate.min.css" rel="stylesheet" type="text/css" />
<div class="leftUtilsWrap">
<div class="leftUtils z-depth-3 ">
<span class="dropdown-toggle item" data-toggle="dropdown"
aria-expanded="true">
<i class="fa fa-angle-down"></i>
</span>
<ul class="dropdown-menu" role="menu"
aria-labelledby="btnGroupVerticalDrop1" id="mapTypeDrop">
<li id="baidu"><a href="javascript:;"> 百度地图 </a></li>
<li id="gaode"><a href="javascript:;"> 高德地图 </a></li>
</ul>
<span class="item" id="trafficItem">
实时路况
</span>
<span class="item" id="openWindow">
新窗口
</span>
</div>
</div>
<div id="mapContainer">
</div>
<div class="mapTools z-depth-3 ">
<div class="item active" data-click="vehicle">
<i class="fa fa-bus"></i> 线路
</div>
<div class="item" data-click="search">
<i class="fa fa-search"></i> 搜索
</div>
<!-- <div class="item" data-click="notice"> -->
<div class="item" >
<i class="fa fa-bell-o"></i> 安全
</div>
<div class="item" data-click="playBack">
<i class="fa fa-history"></i> 回放
</div>
</div>
<!-- 轨迹回放面板 -->
<div class="play-back-list animated fadeInRightBig z-depth-2">
<div class="pback-logs"></div>
</div>
<div class="play-back-btns z-depth-1 animated fadeInUpBig">
<i class="fa fa-play playBtn" data-status=0></i>
<!-- <span id="playSpeed">
<i class="fa fa-close"></i> 1 <i class="fa fa-angle-up" ></i>
</span> -->
<div class="dropup" >
<span id="playSpeed" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-close"></i><span id="playSpeedText">10</span><i class="fa fa-angle-up" ></i>
</span>
<ul class="dropdown-menu play-speed-select" >
<li data-speed=30><a href="javascript:;">1秒30帧 </a></li>
<li data-speed=20><a href="javascript:;">1秒20帧 </a></li>
<li data-speed=10><a href="javascript:;">1秒10帧 </a></li>
<li data-speed=7><a href="javascript:;">1秒7帧 </a></li>
<li data-speed=5><a href="javascript:;">1秒5帧 </a></li>
<li data-speed=1><a href="javascript:;">1秒1帧 </a></li>
</ul>
</div>
<button type="button" class="btn btn-circle red play-back-close" style="line-height: 1;">退出</button>
</div>
<div class="progress-wrap animated fadeInUpBig">
<div class="progress-body">
<div class="play-back-progress "></div>
<div class="play-back-progress-mark"></div>
<div class="progress-mark-info" id="progress-mark-time"></div>
<!-- 跟随鼠标 -->
<div class="progress-mark-info" id="progress-mark-time-mouse"></div>
</div>
</div>
<div class="mapRightWrap z-depth-3 vehicle" >
</div>
<div id="temps"></div>
<script src="/assets/js/TransGPS.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/map/iMap.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/lineGroup.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/search.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/temp.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/real.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/playBack.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/map/platform/baidu.js" data-exclude=1></script>
<script src="/pages/mapmonitor/real/js/map/platform/gaode.js" data-exclude=1></script>
<script>
var consts = {
mapContainer: '#mapContainer',
center_point: {
lng : 121.544336,
lat : 31.221315
},
allGps: {},
trafficBtn: '#trafficItem'//实时路况按钮
}
setTimeout(function(){
iMap.addMap('baidu', '百度地图', baiduMap)
.addMap('gaode', '高德地图', gaodeMap)
.call('init');
}, 500);
//Canvas 带圆角的矩形
CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2;
this.strokeStyle ='rgba(0,102,0,.1)';
this.beginPath();
this.moveTo(x+r, y);
this.arcTo(x+w, y, x+w, y+h, r);
this.arcTo(x+w, y+h, x, y+h, r);
this.arcTo(x, y+h, x, y, r);
this.arcTo(x, y, x+w, y, r);
this.closePath();
return this;
}
//GPS刷新事件
$('#mapContainer').on('gps_refresh', function(e, add, up){
if($(this).is(":hidden"))
return;
var all = add ,gps;
if(up)
all = all.concat(up);
$.each(all, function(){
consts.allGps[this.deviceId] = this;
});
var type = $('.mapTools .item.active').data('click');
console.log(type);
switch (type) {
case 'vehicle':
lineGroup.gpsRefresh();
break;
case 'search':
searchPanel.gpsRefresh();
break;
}
});
</script>