|
16 | 16 |
|
17 | 17 | <portal to="actions"> |
18 | 18 | <div> |
| 19 | + <!-- Stop tracking --> |
| 20 | + <button class="px-5 py-2 mr-3 font-semibold text-white rounded bg-danger dark:bg-dark-danger mobile:block mobile:w-full mobile:m-0 mobile:mb-3" @click="trackedPlayer = null" v-if="trackedPlayer"> |
| 21 | + <i class="fas fa-stop mr-1"></i> |
| 22 | + {{ t('map.stop_track') }} |
| 23 | + </button> |
19 | 24 | <!-- Play/Pause --> |
20 | 25 | <button class="px-5 py-2 mr-3 font-semibold text-white rounded bg-blue-600 dark:bg-blue-500 mobile:block mobile:w-full mobile:m-0 mobile:mb-3" @click="isPaused = true" v-if="!isPaused"> |
21 | 26 | <i class="fas fa-pause"></i> |
@@ -138,6 +143,7 @@ export default { |
138 | 143 | layers: { |
139 | 144 | "Players": L.layerGroup(), |
140 | 145 | "Dead Players": L.layerGroup(), |
| 146 | + "Emergency Vehicles": L.layerGroup(), |
141 | 147 | "Vehicles": L.layerGroup(), |
142 | 148 | "Blips": L.layerGroup(), |
143 | 149 | } |
@@ -313,8 +319,12 @@ export default { |
313 | 319 |
|
314 | 320 | this.layers[layer].addLayer(marker); |
315 | 321 | }, |
316 | | - getLayer(isDriving, isPassenger, isInvisible, isDead) { |
317 | | - if (isDriving || isPassenger) { |
| 322 | + getLayer(player, isDriving, isPassenger, isInvisible, isDead) { |
| 323 | + const vehicle = this.getVehicleType(player.vehicle); |
| 324 | +
|
| 325 | + if (vehicle && (vehicle.type === 'police_car' || vehicle.type === 'ems_car')) { |
| 326 | + return "Emergency Vehicles"; |
| 327 | + } if (isDriving || isPassenger) { |
318 | 328 | return "Vehicles"; |
319 | 329 | } else if (isDead) { |
320 | 330 | return "Dead Players"; |
@@ -398,7 +408,7 @@ export default { |
398 | 408 | markers[id] = marker; |
399 | 409 | } |
400 | 410 |
|
401 | | - _this.addToLayer(markers[id], _this.getLayer(isDriving, isPassenger, isInvisible, isDead)); |
| 411 | + _this.addToLayer(markers[id], _this.getLayer(player, isDriving, isPassenger, isInvisible, isDead)); |
402 | 412 |
|
403 | 413 | let extra = '<br>Altitude: ' + Math.round(player.coords.z) + 'm'; |
404 | 414 | if (speed) { |
@@ -609,8 +619,6 @@ export default { |
609 | 619 | $('#map-wrapper').on('click', '.track-cid', function(e) { |
610 | 620 | e.preventDefault(); |
611 | 621 |
|
612 | | - console.log(this); |
613 | | -
|
614 | 622 | const track = $(this).data('trackid'); |
615 | 623 | if (track === 'stop') { |
616 | 624 | _this.trackedPlayer = null; |
|
0 commit comments