1717 <portal to =" actions" >
1818 <div class =" mb-2" >
1919 <!-- 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 =" stopTracking()" v-if =" trackedPlayer" >
20+ <button
21+ 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"
22+ @click =" stopTracking()" v-if =" trackedPlayer" >
2123 <i class =" fas fa-stop mr-1" ></i >
2224 {{ t('map.stop_track') }}
2325 </button >
2426 <!-- Play/Pause -->
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" >
27+ <button
28+ 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"
29+ @click =" isPaused = true" v-if =" !isPaused" >
2630 <i class =" fas fa-pause" ></i >
2731 {{ t('map.pause') }}
2832 </button >
29- <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 = false" v-if =" isPaused" >
33+ <button
34+ 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"
35+ @click =" isPaused = false" v-if =" isPaused" >
3036 <i class =" fas fa-play" ></i >
3137 {{ t('map.play') }}
3238 </button >
3642 <template >
3743 <div class =" -mt-12" id =" map-wrapper" >
3844 <div class =" flex flex-wrap mb-2" >
39- <input type =" text" class =" form-control w-56 rounded border block mobile:w-full px-4 py-2 bg-gray-200 dark:bg-gray-600" :placeholder =" t('map.track_placeholder')" v-model =" tracking.id" />
40- <select class =" block w-44 ml-2 px-4 py-2 bg-gray-200 dark:bg-gray-600 border rounded mobile:w-full mobile:m-0 mobile:mt-1" v-model =" tracking.type" >
45+ <input type =" text"
46+ class =" form-control w-56 rounded border block mobile:w-full px-4 py-2 bg-gray-200 dark:bg-gray-600"
47+ :placeholder =" t('map.track_placeholder')" v-model =" tracking.id" />
48+ <select
49+ class =" block w-44 ml-2 px-4 py-2 bg-gray-200 dark:bg-gray-600 border rounded mobile:w-full mobile:m-0 mobile:mt-1"
50+ v-model =" tracking.type" >
4151 <option value =" server_" >{{ t('map.track_server') }}</option >
4252 <option value =" " >{{ t('map.track_steam') }}</option >
4353 <option value =" player_" >{{ t('map.track_character') }}</option >
4454 </select >
45- <button class =" px-5 py-2 ml-2 font-semibold text-white rounded bg-primary dark:bg-dark-primary mobile:block mobile:w-full mobile:m-0 mobile:mt-1" @click =" trackId(tracking.type + tracking.id)" >
55+ <button
56+ class =" px-5 py-2 ml-2 font-semibold text-white rounded bg-primary dark:bg-dark-primary mobile:block mobile:w-full mobile:m-0 mobile:mt-1"
57+ @click =" trackId(tracking.type + tracking.id)" >
4658 {{ t('map.do_track') }}
4759 </button >
4860 </div >
4961 <div class =" relative" >
5062 <div id =" map" class =" w-map max-w-full relative h-max" ></div >
51- <pre class =" bg-opacity-70 bg-white coordinate-attr absolute bottom-0 left-0 cursor-pointer z-1k" v-if =" clickedCoords" ><span @click =" copyText($event, clickedCoords)" >{{ clickedCoords }}</span > / <span @click =" copyText($event, coordsCommand)" >{{ t('map.command') }}</span ></pre >
63+ <pre class =" bg-opacity-70 bg-white coordinate-attr absolute bottom-0 left-0 cursor-pointer z-1k"
64+ v-if =" clickedCoords" ><span @click =" copyText($event, clickedCoords)" >{{ clickedCoords }}</span > / <span
65+ @click =" copyText($event, coordsCommand)" >{{ t('map.command') }}</span ></pre >
5266 </div >
5367 <div v-if =" afkPeople" class =" w-map-right pt-4" >
5468 <h3 class =" mb-2" >{{ t('map.afk_title') }}</h3 >
@@ -68,14 +82,15 @@ import {GestureHandling} from "leaflet-gesture-handling";
6882import " leaflet-rotatedmarker" ;
6983import ' leaflet-fullscreen' ;
7084import custom_icons from " ../../data/vehicles.json" ;
85+
7186const Rainbow = require (' rainbowvis.js' );
7287
73- (function (global ){
88+ (function (global ) {
7489 let MarkerMixin = {
7590 _updateZIndex : function (offset ) {
7691 this ._icon .style .zIndex = this .options .forceZIndex ? (this .options .forceZIndex + (this .options .zIndexOffset || 0 )) : (this ._zIndex + offset);
7792 },
78- setForceZIndex : function (forceZIndex ) {
93+ setForceZIndex : function (forceZIndex ) {
7994 this .options .forceZIndex = forceZIndex ? forceZIndex : null ;
8095 }
8196 };
@@ -86,27 +101,27 @@ const Rainbow = require('rainbowvis.js');
86101let playerCallback = null ,
87102 playerCallbackCid = null ,
88103 VueInstance = null ;
89- window .debug = function (cid ) {
104+ window .debug = function (cid ) {
90105 playerCallbackCid = cid;
91- playerCallback = function (player , coords , _this ) {
106+ playerCallback = function (player , coords , _this ) {
92107 console .info (' Player debug' , player);
93108 };
94109};
95- window .track = function (cid ) {
110+ window .track = function (cid ) {
96111 window .location .hash = ' player_' + cid;
97112 window .location .reload ();
98113};
99- window .marker = function (cid ) {
114+ window .marker = function (cid ) {
100115 playerCallbackCid = cid;
101- playerCallback = function (player , coords , _this ) {
116+ playerCallback = function (player , coords , _this ) {
102117 console .info (' Marker' );
103118 const markerCode = ` {lat: ` + coords .lat + ` , lng: ` + coords .lng + ` }` ;
104119 _this .copyText (null , markerCode);
105120
106121 console .info (` {lat: ` + coords .lat + ` , lng: ` + coords .lng + ` }` , ' (Copied to clipboard)' );
107122 };
108123};
109- window .convertCoords = function (coords ) {
124+ window .convertCoords = function (coords ) {
110125 if (VueInstance) {
111126 const converted = VueInstance .convertCoords (coords);
112127
@@ -120,7 +135,7 @@ window.convertCoords = function(coords) {
120135 }
121136};
122137
123- window .loadHistory = function (server , player , day ) {
138+ window .loadHistory = function (server , player , day ) {
124139 if (VueInstance) {
125140 $ .post (VueInstance .hostname () + ' /map/go/history' , {
126141 server: server,
@@ -290,8 +305,8 @@ export default {
290305 size: 23
291306 };
292307
293- $ .each (custom_icons, function (type , cfg ) {
294- if (cfg .models .includes (vehicle .model + " " )) {
308+ $ .each (custom_icons, function (type , cfg ) {
309+ if (cfg .models .includes (vehicle .model + " " )) {
295310 ret .type = type;
296311 ret .size = cfg .size ;
297312 }
@@ -393,7 +408,7 @@ export default {
393408 addToLayer (marker , layer ) {
394409 const _this = this ;
395410
396- $ .each (this .layers , function (key ) {
411+ $ .each (this .layers , function (key ) {
397412 if (layer !== key) {
398413 _this .layers [key].removeLayer (marker);
399414 }
@@ -406,7 +421,8 @@ export default {
406421
407422 if (vehicle && (vehicle .type === ' police_car' || vehicle .type === ' ems_car' )) {
408423 return " Emergency Vehicles" ;
409- } if (isDriving || isPassenger) {
424+ }
425+ if (isDriving || isPassenger) {
410426 return " Vehicles" ;
411427 } else if (isDead) {
412428 return " Dead Players" ;
@@ -425,7 +441,9 @@ export default {
425441 this .map .dragging .enable ();
426442 }
427443
428- if (data && Array .isArray (data)) {
444+ if (data && ' status' in data && data .status ) {
445+ this .data = this .t (' map.advanced_error' , $ (' #server option:selected' ).text (), data .message );
446+ } else if (data && Array .isArray (data)) {
429447 if (this .map ) {
430448 const _this = this ;
431449 let markers = this .markers ;
@@ -591,7 +609,7 @@ export default {
591609 debugLocations (locations ) {
592610 const _this = this ;
593611
594- $ .each (locations, function (k , coords ) {
612+ $ .each (locations, function (k , coords ) {
595613 L .marker (_this .convertCoords (coords),
596614 {
597615 icon: new L.Icon (
@@ -635,7 +653,7 @@ export default {
635653
636654 L .control .layers ({}, this .layers ).addTo (this .map );
637655
638- $ .each (this .layers , function (key ) {
656+ $ .each (this .layers , function (key ) {
639657 _this .layers [key].addTo (_this .map );
640658 });
641659
@@ -684,14 +702,14 @@ export default {
684702 _this .isDragging = false ;
685703 });
686704 this .map .on (' fullscreenchange' , function () {
687- setTimeout (function () {
705+ setTimeout (function () {
688706 _this .map ._onResize ();
689707 }, 500 );
690708 });
691709
692710 this .map .addControl (new L.Control.Fullscreen ());
693711
694- $ (' #map-wrapper' ).on (' click' , ' .track-cid' , function (e ) {
712+ $ (' #map-wrapper' ).on (' click' , ' .track-cid' , function (e ) {
695713 e .preventDefault ();
696714
697715 const track = $ (this ).data (' trackid' );
@@ -734,7 +752,7 @@ export default {
734752 });
735753
736754 if (Math .round (Math .random () * 100 ) === 1 ) { // 1% chance it says fib spy satellite map
737- $ (document ).ready (function () {
755+ $ (document ).ready (function () {
738756 $ (' #map_title' ).text (_this .t (' map.spy_satellite' ));
739757 });
740758 }
0 commit comments