Only reset marker title if it changes.

This commit is contained in:
Oliver Jowett 2015-01-07 21:03:26 +00:00
parent 0f1c0778f2
commit 25ff88c252

View file

@ -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,