|
@ -1,6 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="current-container">
|
3
|
|
<t-scroll-bar :auto-hide="false" class="left">
|
|
3
|
<!-- <t-scroll-bar :auto-hide="false" class="left">
|
4
|
4
|
<div v-for="(item,index) in alarmList" :key="index" :class="[{active:index == activeIndex},'item']" @click="choose(item,index)">
|
5
|
5
|
<div class="top">
|
6
|
6
|
<div class="user-pic"></div>
|
|
@ -30,7 +30,7 @@
|
30
|
30
|
<t-button icon="close" color="primary" @click="close(item)">关闭</t-button>
|
31
|
31
|
</div>
|
32
|
32
|
</div>
|
33
|
|
</t-scroll-bar>
|
|
33
|
</t-scroll-bar> -->
|
34
|
34
|
<div class="right">
|
35
|
35
|
<div id="current-map"></div>
|
36
|
36
|
</div>
|
|
@ -108,6 +108,7 @@ export default {
|
108
|
108
|
}
|
109
|
109
|
},
|
110
|
110
|
mounted() {
|
|
111
|
window.Vue = this
|
111
|
112
|
this.map = new Ai.Map('current-map', {
|
112
|
113
|
ak: 'MTYwMTMMTAwMU1UWXdNVE0wTlRNMU16WTBNeU14TnpRdw__',
|
113
|
114
|
center: [39.915599, 116.406568],
|
|
@ -116,83 +117,126 @@ export default {
|
116
|
117
|
var maplayer = null
|
117
|
118
|
maplayer = Ai.TileLayer('http://192.168.74.189:9999/tdtvector')
|
118
|
119
|
this.map.addLayer(maplayer)
|
119
|
|
var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht:dzht/wmts')
|
|
120
|
var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht/dzht/wmts')
|
120
|
121
|
this.map.addLayer(la)
|
121
|
|
},
|
122
|
|
methods: {
|
123
|
|
choose(item, index) {
|
124
|
|
this.activeIndex = index
|
125
|
|
if (this.map.hasLayer(this.alarmPoint)) {
|
126
|
|
this.map.removeLayer(this.alarmPoint)
|
127
|
|
}
|
128
|
|
if (this.map.hasLayer(this.rescuePoint)) {
|
129
|
|
this.map.removeLayer(this.rescuePoint)
|
130
|
|
}
|
131
|
|
if (this.map.hasLayer(this.polyline)) {
|
132
|
|
this.map.removeLayer(this.polyline)
|
133
|
|
}
|
134
|
|
var icon = Ai.Icon({
|
|
122
|
if (this.map.hasLayer(this.alarmPoint)) {
|
|
123
|
this.map.removeLayer(this.alarmPoint)
|
|
124
|
}
|
|
125
|
if (this.map.hasLayer(this.rescuePoint)) {
|
|
126
|
this.map.removeLayer(this.rescuePoint)
|
|
127
|
}
|
|
128
|
if (this.map.hasLayer(this.polyline)) {
|
|
129
|
this.map.removeLayer(this.polyline)
|
|
130
|
}
|
|
131
|
var icon = Ai.Icon({
|
135
|
132
|
// 设置图标URL路径
|
136
|
|
iconUrl: '/static/images/worker(1).png',
|
137
|
|
// 设置图标大小
|
138
|
|
iconSize: [20, 20],
|
139
|
|
// 设置点对象和图标的相对偏移量
|
140
|
|
iconAnchor: [0, 0]
|
141
|
|
})
|
142
|
|
this.alarmPoint = Ai.Point([29.86089241772908, 122.09930419921876], {icon: icon})
|
143
|
|
this.alarmPoint.on('click', (e) => {
|
144
|
|
console.log(e)
|
145
|
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
|
146
|
|
'<div>终端编号</div>' +
|
147
|
|
'<div>ZDBH0001</div>' +
|
148
|
|
'</div>' +
|
149
|
|
'<div class="row">' +
|
150
|
|
'<div>最新定位时间</div>' +
|
151
|
|
'<div>2020.08.13 08:24:32</div>' +
|
152
|
|
'</div></div></div>'
|
153
|
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
154
|
|
// 设置弹出框弹出位置
|
155
|
|
.setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
|
156
|
|
// 设置弹出框弹出内容
|
157
|
|
.setContent(content)
|
158
|
|
.openOn(this.map)
|
159
|
|
})
|
160
|
|
this.map.addLayer(this.alarmPoint)
|
161
|
|
this.rescuePoint = Ai.Point([29.388158098102554, 122.45361328125], {icon: Ai.Icon({
|
|
133
|
iconUrl: '/static/images/worker(1).png',
|
|
134
|
// 设置图标大小
|
|
135
|
iconSize: [20, 20],
|
|
136
|
// 设置点对象和图标的相对偏移量
|
|
137
|
iconAnchor: [0, 0]
|
|
138
|
})
|
|
139
|
// 救援人员弹窗
|
|
140
|
this.alarmPoint = Ai.Point([29.86089241772908, 122.09930419921876], {icon: icon})
|
|
141
|
this.alarmPoint.on('click', (e) => {
|
|
142
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
|
|
143
|
'<div>终端编号</div>' +
|
|
144
|
'<div>ZDBH0001</div>' +
|
|
145
|
'</div>' +
|
|
146
|
'<div class="row">' +
|
|
147
|
'<div>最新定位时间</div>' +
|
|
148
|
'<div>2020.08.13 08:24:32</div>' +
|
|
149
|
'</div></div></div>' +
|
|
150
|
'<div style="display:flex;">' +
|
|
151
|
'<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
|
|
152
|
'<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
|
|
153
|
'</div></div></div>'
|
|
154
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
|
155
|
// 设置弹出框弹出位置
|
|
156
|
.setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
|
|
157
|
// 设置弹出框弹出内容
|
|
158
|
.setContent(content)
|
|
159
|
.openOn(this.map)
|
|
160
|
})
|
|
161
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
|
|
162
|
'<div>终端编号</div>' +
|
|
163
|
'<div>ZDBH0001</div>' +
|
|
164
|
'</div>' +
|
|
165
|
'<div class="row">' +
|
|
166
|
'<div>最新定位时间</div>' +
|
|
167
|
'<div>2020.08.13 08:24:32</div>' +
|
|
168
|
'</div></div></div>' +
|
|
169
|
'<div style="display:flex;">' +
|
|
170
|
'<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
|
|
171
|
'<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
|
|
172
|
'</div></div></div>'
|
|
173
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
|
174
|
// 设置弹出框弹出位置
|
|
175
|
.setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
|
|
176
|
// 设置弹出框弹出内容
|
|
177
|
.setContent(content)
|
|
178
|
.openOn(this.map)
|
|
179
|
this.map.addLayer(this.alarmPoint)
|
|
180
|
// 报警人员弹窗
|
|
181
|
this.rescuePoint = Ai.Point([29.388158098102554, 122.45361328125], {icon: Ai.Icon({
|
162
|
182
|
// 设置图标URL路径
|
163
|
|
iconUrl: '/static/images/worker.png',
|
164
|
|
// 设置图标大小
|
165
|
|
iconSize: [20, 20],
|
166
|
|
// 设置点对象和图标的相对偏移量
|
167
|
|
iconAnchor: [0, 0]
|
168
|
|
})})
|
169
|
|
this.rescuePoint.on('click', (e) => {
|
170
|
|
console.log(e)
|
171
|
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
|
172
|
|
'<div>终端编号</div>' +
|
173
|
|
'<div>ZDBH0001</div>' +
|
174
|
|
'</div>' +
|
175
|
|
'<div class="row">' +
|
176
|
|
'<div>最新定位时间</div>' +
|
177
|
|
'<div>2020.08.13 08:24:32</div>' +
|
178
|
|
'</div></div></div>'
|
179
|
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
180
|
|
// 设置弹出框弹出位置
|
181
|
|
.setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
|
182
|
|
// 设置弹出框弹出内容
|
183
|
|
.setContent(content)
|
184
|
|
.openOn(this.map)
|
185
|
|
})
|
186
|
|
this.map.addLayer(this.rescuePoint)
|
187
|
|
var lineWktstr = 'LINESTRING ( 122.09930419921876 29.86089241772908,122.18582153320314 29.6913335169976,122.21878051757814 29.42494595179543,122.45361328125 29.388158098102554)'
|
188
|
|
this.polyline = Ai.Polyline(lineWktstr, {color: 'red'})
|
189
|
|
this.map.addLayer(this.polyline)
|
190
|
|
this.map.on('click', function(evt) {
|
191
|
|
var lat = evt.latlng.lat // 点击地图时的纬度
|
192
|
|
var lng = evt.latlng.lng // 点击地图时的经度
|
193
|
|
console.log(lng, lat)
|
194
|
|
})
|
195
|
|
},
|
|
183
|
iconUrl: '/static/images/worker.png',
|
|
184
|
// 设置图标大小
|
|
185
|
iconSize: [20, 20],
|
|
186
|
// 设置点对象和图标的相对偏移量
|
|
187
|
iconAnchor: [0, 0]
|
|
188
|
})})
|
|
189
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
|
|
190
|
'<div>终端编号</div>' +
|
|
191
|
'<div>ZDBH0001</div>' +
|
|
192
|
'</div>' +
|
|
193
|
'<div class="row">' +
|
|
194
|
'<div>最新定位时间</div>' +
|
|
195
|
'<div>2020.08.13 08:24:32</div>' +
|
|
196
|
'</div></div></div>' +
|
|
197
|
'<div style="display:flex;">' +
|
|
198
|
'<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
|
|
199
|
'<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
|
|
200
|
'</div></div></div>'
|
|
201
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
|
202
|
// 设置弹出框弹出位置
|
|
203
|
.setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
|
|
204
|
// 设置弹出框弹出内容
|
|
205
|
.setContent(content)
|
|
206
|
.openOn(this.map)
|
|
207
|
|
|
208
|
this.rescuePoint.on('click', (e) => {
|
|
209
|
console.log(e)
|
|
210
|
var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
|
|
211
|
'<div>终端编号</div>' +
|
|
212
|
'<div>ZDBH0001</div>' +
|
|
213
|
'</div>' +
|
|
214
|
'<div class="row">' +
|
|
215
|
'<div>最新定位时间</div>' +
|
|
216
|
'<div>2020.08.13 08:24:32</div>' +
|
|
217
|
'</div></div></div>' +
|
|
218
|
'<div style="display:flex;">' +
|
|
219
|
'<button class="point-out" onClick="window.Vue.modal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
|
|
220
|
'<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
|
|
221
|
'</div></div></div>'
|
|
222
|
var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
|
|
223
|
// 设置弹出框弹出位置
|
|
224
|
.setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
|
|
225
|
// 设置弹出框弹出内容
|
|
226
|
.setContent(content)
|
|
227
|
.openOn(this.map)
|
|
228
|
})
|
|
229
|
this.map.addLayer(this.rescuePoint)
|
|
230
|
var lineWktstr = 'LINESTRING ( 122.09930419921876 29.86089241772908,122.18582153320314 29.6913335169976,122.21878051757814 29.42494595179543,122.45361328125 29.388158098102554)'
|
|
231
|
this.polyline = Ai.Polyline(lineWktstr, {color: 'red'})
|
|
232
|
this.map.addLayer(this.polyline)
|
|
233
|
this.map.on('click', function(evt) {
|
|
234
|
var lat = evt.latlng.lat // 点击地图时的纬度
|
|
235
|
var lng = evt.latlng.lng // 点击地图时的经度
|
|
236
|
console.log(lng, lat)
|
|
237
|
})
|
|
238
|
},
|
|
239
|
methods: {
|
196
|
240
|
showModal(item) {
|
197
|
241
|
this.modal = true
|
198
|
242
|
},
|
|
@ -216,4 +260,5 @@ export default {
|
216
|
260
|
}
|
217
|
261
|
}
|
218
|
262
|
}
|
|
263
|
|
219
|
264
|
</script>
|