From bfe5afe0698d2c48e19807e58716acc5b7f0eefc Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Thu, 8 Jul 2021 20:52:29 +0200 Subject: [PATCH] MousePosition: allow rendering of empty string --- src/ol/control/MousePosition.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ol/control/MousePosition.js b/src/ol/control/MousePosition.js index 1d96ba7352..fb6e2bdff9 100644 --- a/src/ol/control/MousePosition.js +++ b/src/ol/control/MousePosition.js @@ -35,8 +35,8 @@ const COORDINATE_FORMAT = 'coordinateFormat'; * @property {string} [undefinedHTML=' '] Markup to show when coordinates are not * available (e.g. when the pointer leaves the map viewport). By default, the last position * will be replaced with `' '` (` `) when the pointer leaves the viewport. To - * retain the last rendered position, set this option to something falsey (like an empty - * string `''`). + * retain the last rendered position, set this option to something falsey. An exception is an + * empty string `''`. It does not count as falsey in this case. */ /** @@ -89,7 +89,8 @@ class MousePosition extends Control { * @private * @type {boolean} */ - this.renderOnMouseOut_ = !!this.undefinedHTML_; + this.renderOnMouseOut_ = + this.undefinedHTML_ === '' || !!this.undefinedHTML_; /** * @private