Skip to content

Commit

Permalink
fixed last known coordinate (#2027)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Forsgren <[email protected]>
  • Loading branch information
steff-o and Stefan Forsgren authored Jun 27, 2024
1 parent 8bc7b84 commit 7030ace
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/controls/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ const Position = function Position(options = {}) {
let currentCaretPos;
let inputEl;

/**
* Converts origo spec configuration for placeholder to that of OL MousePosition. Originally they were the same, but since OL ver 7.0
* only undefined is treated as "use last known coordinate".
* @returns String with placeholder or undefined if last known position should be used.
*/
function placeholder() {
return noPositionText.length === 0 ? noPositionText === false : noPositionText;
return noPositionText.length === 0 ? undefined : noPositionText;
}

function removeNoCoordsEl() {
Expand Down

0 comments on commit 7030ace

Please sign in to comment.