ol 7.0.0-dev.1659254427776 → 7.0.0-dev.1659255011672
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29,17 +29,12 @@ export type Options = {
|
|
|
29
29
|
target?: string | HTMLElement | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Markup to show when the mouse position is not
|
|
32
|
-
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space
|
|
33
|
-
* is
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* will be the default behavior.
|
|
32
|
+
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space is rendered
|
|
33
|
+
* initially and the last position is retained when the mouse leaves the viewport.
|
|
34
|
+
* When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
|
|
35
|
+
* placeholder.
|
|
37
36
|
*/
|
|
38
|
-
placeholder?: string |
|
|
39
|
-
/**
|
|
40
|
-
* This option is deprecated. Use the `placeholder` option instead.
|
|
41
|
-
*/
|
|
42
|
-
undefinedHTML?: string | undefined;
|
|
37
|
+
placeholder?: string | undefined;
|
|
43
38
|
};
|
|
44
39
|
/***
|
|
45
40
|
* @template Return
|
|
@@ -59,13 +54,11 @@ export type Options = {
|
|
|
59
54
|
* callback.
|
|
60
55
|
* @property {HTMLElement|string} [target] Specify a target if you want the
|
|
61
56
|
* control to be rendered outside of the map's viewport.
|
|
62
|
-
* @property {string
|
|
63
|
-
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space
|
|
64
|
-
* is
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* will be the default behavior.
|
|
68
|
-
* @property {string} [undefinedHTML=' '] This option is deprecated. Use the `placeholder` option instead.
|
|
57
|
+
* @property {string} [placeholder] Markup to show when the mouse position is not
|
|
58
|
+
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space is rendered
|
|
59
|
+
* initially and the last position is retained when the mouse leaves the viewport.
|
|
60
|
+
* When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
|
|
61
|
+
* placeholder.
|
|
69
62
|
*/
|
|
70
63
|
/**
|
|
71
64
|
* @classdesc
|
|
@@ -98,14 +91,14 @@ declare class MousePosition extends Control {
|
|
|
98
91
|
un: MousePositionOnSignature<void>;
|
|
99
92
|
/**
|
|
100
93
|
* @private
|
|
101
|
-
* @type {
|
|
94
|
+
* @type {boolean}
|
|
102
95
|
*/
|
|
103
|
-
private
|
|
96
|
+
private renderOnMouseOut_;
|
|
104
97
|
/**
|
|
105
98
|
* @private
|
|
106
|
-
* @type {
|
|
99
|
+
* @type {string}
|
|
107
100
|
*/
|
|
108
|
-
private
|
|
101
|
+
private placeholder_;
|
|
109
102
|
/**
|
|
110
103
|
* @private
|
|
111
104
|
* @type {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MousePosition.d.ts","sourceRoot":"","sources":["MousePosition.js"],"names":[],"mappings":";;;;+CA0Ba,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,oBAAoB,EAAE,KAAK,GAC1E,yBAA+B,GAAC,mBAAmB,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GAC7F,OAAW,eAAe,EAAE,mBAAmB,CAAC,OAAO,eAAe,EAAE,UAAU,GAAC,OAAO,oBAAoB,EAAE,KAAK,GACrH,yBAA+B,GAAC,mBAAmB,EAAE,MAAM,CAAC;;;;;;;;;;;;;iBAO/C,OAAO,YAAY,EAAE,cAAc;;;;;;qBAC1B,OAAO,gBAAgB,EAAE,OAAO,KAAE,IAAI
|
|
1
|
+
{"version":3,"file":"MousePosition.d.ts","sourceRoot":"","sources":["MousePosition.js"],"names":[],"mappings":";;;;+CA0Ba,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,E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AAO,YAAY,EAAE,cAAc,QAO7C;IAED;;;OAGG;IACH,oBAqCC;CAmBF"}
|
package/control/MousePosition.js
CHANGED
|
@@ -41,13 +41,11 @@ const COORDINATE_FORMAT = 'coordinateFormat';
|
|
|
41
41
|
* callback.
|
|
42
42
|
* @property {HTMLElement|string} [target] Specify a target if you want the
|
|
43
43
|
* control to be rendered outside of the map's viewport.
|
|
44
|
-
* @property {string
|
|
45
|
-
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space
|
|
46
|
-
* is
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* will be the default behavior.
|
|
50
|
-
* @property {string} [undefinedHTML=' '] This option is deprecated. Use the `placeholder` option instead.
|
|
44
|
+
* @property {string} [placeholder] Markup to show when the mouse position is not
|
|
45
|
+
* available (e.g. when the pointer leaves the map viewport). By default, a non-breaking space is rendered
|
|
46
|
+
* initially and the last position is retained when the mouse leaves the viewport.
|
|
47
|
+
* When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
|
|
48
|
+
* placeholder.
|
|
51
49
|
*/
|
|
52
50
|
|
|
53
51
|
/**
|
|
@@ -104,41 +102,16 @@ class MousePosition extends Control {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
/**
|
|
107
|
-
*
|
|
105
|
+
* @private
|
|
108
106
|
* @type {boolean}
|
|
109
107
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @type {string}
|
|
114
|
-
*/
|
|
115
|
-
let placeholder = ' ';
|
|
116
|
-
|
|
117
|
-
if ('undefinedHTML' in options) {
|
|
118
|
-
// deprecated behavior
|
|
119
|
-
if (options.undefinedHTML !== undefined) {
|
|
120
|
-
placeholder = options.undefinedHTML;
|
|
121
|
-
}
|
|
122
|
-
renderOnMouseOut = !!placeholder;
|
|
123
|
-
} else if ('placeholder' in options) {
|
|
124
|
-
if (options.placeholder === false) {
|
|
125
|
-
renderOnMouseOut = false;
|
|
126
|
-
} else {
|
|
127
|
-
placeholder = String(options.placeholder);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
108
|
+
this.renderOnMouseOut_ = options.placeholder !== undefined;
|
|
130
109
|
|
|
131
110
|
/**
|
|
132
111
|
* @private
|
|
133
112
|
* @type {string}
|
|
134
113
|
*/
|
|
135
|
-
this.placeholder_ = placeholder;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @private
|
|
139
|
-
* @type {boolean}
|
|
140
|
-
*/
|
|
141
|
-
this.renderOnMouseOut_ = renderOnMouseOut;
|
|
114
|
+
this.placeholder_ = this.renderOnMouseOut_ ? options.placeholder : ' ';
|
|
142
115
|
|
|
143
116
|
/**
|
|
144
117
|
* @private
|