Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 4c36882

Browse files
committed
- Added Stop tracking button
- Added Emergency Vehicles layer group
1 parent 018a6ab commit 4c36882

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

resources/js/Pages/Map/Index.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
<portal to="actions">
1818
<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>
1924
<!-- Play/Pause -->
2025
<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">
2126
<i class="fas fa-pause"></i>
@@ -138,6 +143,7 @@ export default {
138143
layers: {
139144
"Players": L.layerGroup(),
140145
"Dead Players": L.layerGroup(),
146+
"Emergency Vehicles": L.layerGroup(),
141147
"Vehicles": L.layerGroup(),
142148
"Blips": L.layerGroup(),
143149
}
@@ -313,8 +319,12 @@ export default {
313319
314320
this.layers[layer].addLayer(marker);
315321
},
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) {
318328
return "Vehicles";
319329
} else if (isDead) {
320330
return "Dead Players";
@@ -398,7 +408,7 @@ export default {
398408
markers[id] = marker;
399409
}
400410
401-
_this.addToLayer(markers[id], _this.getLayer(isDriving, isPassenger, isInvisible, isDead));
411+
_this.addToLayer(markers[id], _this.getLayer(player, isDriving, isPassenger, isInvisible, isDead));
402412
403413
let extra = '<br>Altitude: ' + Math.round(player.coords.z) + 'm';
404414
if (speed) {
@@ -609,8 +619,6 @@ export default {
609619
$('#map-wrapper').on('click', '.track-cid', function(e) {
610620
e.preventDefault();
611621
612-
console.log(this);
613-
614622
const track = $(this).data('trackid');
615623
if (track === 'stop') {
616624
_this.trackedPlayer = null;

0 commit comments

Comments
 (0)