From 25ff88c2522ab1074af1c1ee5c6080c774382d2c Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Wed, 7 Jan 2015 21:03:26 +0000 Subject: [PATCH] Only reset marker title if it changes. --- public_html/planeObject.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public_html/planeObject.js b/public_html/planeObject.js index c5e7214..bec0215 100644 --- a/public_html/planeObject.js +++ b/public_html/planeObject.js @@ -303,11 +303,9 @@ PlaneObject.prototype.updateMarker = function(moved) { } // Setting the marker title - if (this.flight === null || this.flight.length == 0) { - this.marker.setTitle(this.hex); - } else { - this.marker.setTitle(this.flight+' ('+this.icao+')'); - } + var title = (this.flight === null || this.flight.length == 0) ? this.icao : (this.flight+' ('+this.icao+')'); + if (title !== this.marker.title) + this.marker.setTitle(title); }; // Update our planes tail line,