Skip to content

Commit

Permalink
Increase rate of marker location updates on the map
Browse files Browse the repository at this point in the history
  • Loading branch information
MillionthOdin16 committed Aug 29, 2023
1 parent a60252a commit d976ff9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/RustPlus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ export default {
error: null,
autoRefreshTimer: null,
markerRefreshTimer: null,
/* map config */
mapZoom: 1,
Expand Down Expand Up @@ -648,6 +649,7 @@ export default {
// setup auto refresh
this.autoRefreshTimer = setInterval(this.reload, 15000);
this.markerRefreshTimer = setInterval(this.refreshMarkers, 3000);
},
onDisconnected: function() {
Expand Down Expand Up @@ -815,6 +817,10 @@ export default {
clearInterval(this.autoRefreshTimer);
}
if(this.markerRefreshTimer){
clearInterval(this.markerRefreshTimer);
}
if(this.websocket){
this.websocket.close();
this.websocket = null;
Expand Down Expand Up @@ -901,6 +907,20 @@ export default {
this.getTime();
},
refreshMarkers: function() {
// make sure connected
if(this.status !== 'connected'){
return;
}
this.getMapMarkers();
this.getTeamInfo();
this.getTime();
},
getInfo: function(callback) {
this.sendRequest({
getInfo: {
Expand Down

0 comments on commit d976ff9

Please sign in to comment.