From 7430ca09fa0e17c1d0fbec258c9f94e4b9fe5129 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Thu, 25 Oct 2018 17:11:21 -0700 Subject: [PATCH] Merge branch 'mouse-footer-activate' of https://github.com/jaller94/mapscii into jaller94-mouse-footer-activate --- src/Mapscii.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mapscii.js b/src/Mapscii.js index ff57f71..920800f 100644 --- a/src/Mapscii.js +++ b/src/Mapscii.js @@ -246,9 +246,12 @@ class Mapscii { // tile = utils.ll2tile(this.center.lon, this.center.lat, this.zoom); // `tile: ${utils.digits(tile.x, 3)}, ${utils.digits(tile.x, 3)} `+ - return `center: ${utils.digits(this.center.lat, 3)}, ${utils.digits(this.center.lon, 3)} `+ - `zoom: ${utils.digits(this.zoom, 2)} `+ - `mouse: ${utils.digits(this.mousePosition.lat, 3)}, ${utils.digits(this.mousePosition.lon, 3)} `; + let footer = `center: ${utils.digits(this.center.lat, 3)}, ${utils.digits(this.center.lon, 3)} `; + footer += ` zoom: ${utils.digits(this.zoom, 2)} `; + if (this.mousePosition.lat !== undefined) { + footer += ` mouse: ${utils.digits(this.mousePosition.lat, 3)}, ${utils.digits(this.mousePosition.lon, 3)} `; + } + return footer; } notify(text) {