ol 7.1.1-dev.1666621240700 → 7.1.1-dev.1666640574913

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.
@@ -35,6 +35,11 @@ export type Options = {
35
35
  * placeholder.
36
36
  */
37
37
  placeholder?: string | undefined;
38
+ /**
39
+ * Wrap the world horizontally on the projection's antimeridian, if it
40
+ * is a global projection.
41
+ */
42
+ wrapX?: boolean | undefined;
38
43
  };
39
44
  /***
40
45
  * @template Return
@@ -59,6 +64,8 @@ export type Options = {
59
64
  * initially and the last position is retained when the mouse leaves the viewport.
60
65
  * When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
61
66
  * placeholder.
67
+ * @property {boolean} [wrapX=true] Wrap the world horizontally on the projection's antimeridian, if it
68
+ * is a global projection.
62
69
  */
63
70
  /**
64
71
  * @classdesc
@@ -114,6 +121,11 @@ declare class MousePosition extends Control {
114
121
  * @type {?import("../proj.js").TransformFunction}
115
122
  */
116
123
  private transform_;
124
+ /**
125
+ * @private
126
+ * @type {boolean}
127
+ */
128
+ private wrapX_;
117
129
  /**
118
130
  * @private
119
131
  */
@@ -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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13
  import {listen} from '../events.js';
14
+ import {wrapX} from '../coordinate.js';
14
15
 
15
16
  /**
16
17
  * @type {string}
@@ -46,6 +47,8 @@ const COORDINATE_FORMAT = 'coordinateFormat';
46
47
  * initially and the last position is retained when the mouse leaves the viewport.
47
48
  * When a string is provided (e.g. `'no position'` or `''` for an empty string) it is used as a
48
49
  * placeholder.
50
+ * @property {boolean} [wrapX=true] Wrap the world horizontally on the projection's antimeridian, if it
51
+ * is a global projection.
49
52
  */
50
53
 
51
54
  /**
@@ -130,6 +133,12 @@ class MousePosition extends Control {
130
133
  * @type {?import("../proj.js").TransformFunction}
131
134
  */
132
135
  this.transform_ = null;
136
+
137
+ /**
138
+ * @private
139
+ * @type {boolean}
140
+ */
141
+ this.wrapX_ = options.wrapX === false ? false : true;
133
142
  }
134
143
 
135
144
  /**
@@ -258,6 +267,11 @@ class MousePosition extends Control {
258
267
  );
259
268
  }
260
269
  this.transform_(coordinate, coordinate);
270
+ if (this.wrapX_) {
271
+ const projection =
272
+ userProjection || this.getProjection() || this.mapProjection_;
273
+ wrapX(coordinate, projection);
274
+ }
261
275
  const coordinateFormat = this.getCoordinateFormat();
262
276
  if (coordinateFormat) {
263
277
  html = coordinateFormat(coordinate);