ol 7.1.1-pr.14101.2 → 7.2.0
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.
- package/AssertionError.d.ts.map +1 -1
- package/AssertionError.js +1 -0
- package/DataTile.d.ts +34 -11
- package/DataTile.d.ts.map +1 -1
- package/DataTile.js +84 -7
- package/Feature.d.ts +3 -3
- package/Feature.js +3 -3
- package/Geolocation.d.ts +34 -27
- package/Geolocation.d.ts.map +1 -1
- package/Geolocation.js +30 -12
- package/Map.d.ts +19 -6
- package/Map.d.ts.map +1 -1
- package/Map.js +70 -43
- package/MapBrowserEventHandler.d.ts.map +1 -1
- package/MapBrowserEventHandler.js +9 -13
- package/Overlay.d.ts +1 -1
- package/Overlay.js +1 -1
- package/README.md +9 -1
- package/Tile.d.ts +2 -2
- package/Tile.js +1 -1
- package/TileCache.d.ts.map +1 -1
- package/TileCache.js +6 -8
- package/array.d.ts +2 -2
- package/array.d.ts.map +1 -1
- package/array.js +4 -4
- package/console.d.ts +13 -0
- package/console.d.ts.map +1 -0
- package/console.js +54 -0
- package/control/MousePosition.d.ts +12 -0
- package/control/MousePosition.d.ts.map +1 -1
- package/control/MousePosition.js +14 -0
- package/coordinate.d.ts +11 -11
- package/coordinate.js +11 -11
- package/dist/ol.js +1 -3
- package/dist/ol.js.map +1 -1
- package/featureloader.d.ts.map +1 -1
- package/featureloader.js +0 -1
- package/format/KML.js +3 -1
- package/geom/flat/interiorpoint.js +2 -2
- package/interaction/DragPan.d.ts.map +1 -1
- package/interaction/DragPan.js +3 -2
- package/interaction/Draw.d.ts.map +1 -1
- package/interaction/Draw.js +11 -14
- package/interaction/KeyboardPan.d.ts.map +1 -1
- package/interaction/KeyboardPan.js +0 -1
- package/interaction/KeyboardZoom.d.ts.map +1 -1
- package/interaction/KeyboardZoom.js +0 -1
- package/interaction/Link.d.ts +14 -0
- package/interaction/Link.d.ts.map +1 -1
- package/interaction/Link.js +37 -6
- package/interaction/Modify.d.ts +10 -10
- package/interaction/Modify.d.ts.map +1 -1
- package/interaction/Modify.js +15 -15
- package/interaction/PinchRotate.d.ts.map +1 -1
- package/interaction/PinchRotate.js +3 -5
- package/interaction/PinchZoom.d.ts.map +1 -1
- package/interaction/PinchZoom.js +3 -5
- package/interaction/Pointer.d.ts +5 -2
- package/interaction/Pointer.d.ts.map +1 -1
- package/interaction/Pointer.js +2 -2
- package/interaction/Select.d.ts.map +1 -1
- package/interaction/Select.js +4 -5
- package/interaction/Snap.d.ts +1 -1
- package/interaction/Snap.d.ts.map +1 -1
- package/interaction/Snap.js +17 -23
- package/interaction/Translate.d.ts +12 -11
- package/interaction/Translate.d.ts.map +1 -1
- package/interaction/Translate.js +16 -13
- package/layer/BaseVector.js +1 -1
- package/layer/Graticule.d.ts.map +1 -1
- package/layer/Graticule.js +4 -4
- package/layer/Heatmap.js +10 -10
- package/layer/Layer.d.ts +2 -2
- package/layer/Layer.d.ts.map +1 -1
- package/layer/Layer.js +2 -2
- package/layer/VectorTile.js +1 -1
- package/package.json +2 -2
- package/proj.d.ts +2 -4
- package/proj.d.ts.map +1 -1
- package/proj.js +4 -6
- package/render/canvas/ExecutorGroup.d.ts.map +1 -1
- package/render/canvas/ExecutorGroup.js +6 -4
- package/render/canvas/Immediate.d.ts +5 -0
- package/render/canvas/Immediate.d.ts.map +1 -1
- package/render/canvas/Immediate.js +15 -0
- package/render/canvas/hitdetect.d.ts +4 -3
- package/render/canvas/hitdetect.d.ts.map +1 -1
- package/render/canvas/hitdetect.js +23 -11
- package/render/webgl/BatchRenderer.d.ts.map +1 -1
- package/render/webgl/BatchRenderer.js +2 -3
- package/render/webgl/LineStringBatchRenderer.d.ts.map +1 -1
- package/render/webgl/LineStringBatchRenderer.js +2 -4
- package/render/webgl/PointBatchRenderer.d.ts.map +1 -1
- package/render/webgl/PointBatchRenderer.js +2 -4
- package/render/webgl/PolygonBatchRenderer.d.ts.map +1 -1
- package/render/webgl/PolygonBatchRenderer.js +2 -4
- package/render.d.ts +3 -3
- package/render.d.ts.map +1 -1
- package/render.js +6 -4
- package/renderer/Layer.d.ts +2 -2
- package/renderer/Layer.d.ts.map +1 -1
- package/renderer/Layer.js +3 -4
- package/renderer/canvas/Layer.d.ts.map +1 -1
- package/renderer/canvas/Layer.js +3 -4
- package/renderer/canvas/TileLayer.js +2 -2
- package/renderer/canvas/VectorImageLayer.d.ts +6 -0
- package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorImageLayer.js +22 -25
- package/renderer/canvas/VectorLayer.d.ts +9 -2
- package/renderer/canvas/VectorLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorLayer.js +87 -93
- package/renderer/canvas/VectorTileLayer.js +84 -84
- package/renderer/webgl/PointsLayer.d.ts.map +1 -1
- package/renderer/webgl/PointsLayer.js +10 -13
- package/renderer/webgl/TileLayer.d.ts.map +1 -1
- package/renderer/webgl/TileLayer.js +2 -4
- package/reproj/DataTile.d.ts +75 -17
- package/reproj/DataTile.d.ts.map +1 -1
- package/reproj/DataTile.js +121 -120
- package/reproj/Tile.d.ts +3 -3
- package/reproj/Tile.d.ts.map +1 -1
- package/reproj/Tile.js +37 -41
- package/reproj/Triangulation.d.ts.map +1 -1
- package/reproj/Triangulation.js +42 -44
- package/source/BingMaps.d.ts.map +1 -1
- package/source/BingMaps.js +33 -38
- package/source/DataTile.d.ts +5 -3
- package/source/DataTile.d.ts.map +1 -1
- package/source/DataTile.js +24 -20
- package/source/GeoTIFF.d.ts +10 -7
- package/source/GeoTIFF.d.ts.map +1 -1
- package/source/GeoTIFF.js +49 -20
- package/source/Image.d.ts +8 -0
- package/source/Image.d.ts.map +1 -1
- package/source/Image.js +13 -11
- package/source/OGCMapTile.d.ts +1 -0
- package/source/OGCMapTile.d.ts.map +1 -1
- package/source/OGCMapTile.js +3 -1
- package/source/OGCVectorTile.d.ts +1 -0
- package/source/OGCVectorTile.d.ts.map +1 -1
- package/source/OGCVectorTile.js +3 -1
- package/source/Raster.d.ts +16 -0
- package/source/Raster.d.ts.map +1 -1
- package/source/Raster.js +47 -7
- package/source/Source.d.ts +2 -2
- package/source/Source.d.ts.map +1 -1
- package/source/Source.js +3 -4
- package/source/Stamen.js +2 -2
- package/source/Tile.d.ts.map +1 -1
- package/source/Tile.js +7 -3
- package/source/TileImage.d.ts +2 -2
- package/source/TileImage.d.ts.map +1 -1
- package/source/TileImage.js +3 -4
- package/source/UTFGrid.d.ts.map +1 -1
- package/source/UTFGrid.js +3 -6
- package/source/Vector.d.ts +6 -6
- package/source/Vector.js +13 -13
- package/source/VectorTile.d.ts.map +1 -1
- package/source/VectorTile.js +5 -9
- package/source/Zoomify.d.ts.map +1 -1
- package/source/Zoomify.js +4 -7
- package/style/Icon.d.ts +51 -0
- package/style/Icon.d.ts.map +1 -1
- package/style/Icon.js +119 -0
- package/style/IconImage.d.ts.map +1 -1
- package/style/IconImage.js +3 -1
- package/style/Image.d.ts.map +1 -1
- package/style/Image.js +1 -0
- package/style/Style.d.ts +2 -2
- package/style/Style.js +2 -2
- package/style/expressions.js +5 -10
- package/tilegrid/TileGrid.d.ts.map +1 -1
- package/tilegrid/TileGrid.js +7 -12
- package/util.d.ts.map +1 -1
- package/util.js +1 -1
- package/webgl/Helper.d.ts +4 -0
- package/webgl/Helper.d.ts.map +1 -1
- package/webgl/Helper.js +78 -79
- package/webgl/PostProcessingPass.d.ts +2 -2
- package/webgl/PostProcessingPass.d.ts.map +1 -1
- package/webgl/PostProcessingPass.js +7 -9
- package/webgl/ShaderBuilder.d.ts +1 -1
- package/webgl/ShaderBuilder.js +1 -1
- package/webgl/TileTexture.d.ts +19 -2
- package/webgl/TileTexture.d.ts.map +1 -1
- package/webgl/TileTexture.js +93 -46
- package/worker/webgl.js +1 -1
- package/layer/STAC.d.ts +0 -257
- package/layer/STAC.d.ts.map +0 -1
- package/layer/STAC.js +0 -312
package/Map.js
CHANGED
|
@@ -30,17 +30,19 @@ import {assert} from './asserts.js';
|
|
|
30
30
|
import {
|
|
31
31
|
clone,
|
|
32
32
|
createOrUpdateEmpty,
|
|
33
|
-
equals,
|
|
33
|
+
equals as equalsExtent,
|
|
34
34
|
getForViewAndSize,
|
|
35
35
|
isEmpty,
|
|
36
36
|
} from './extent.js';
|
|
37
37
|
import {defaults as defaultControls} from './control/defaults.js';
|
|
38
38
|
import {defaults as defaultInteractions} from './interaction/defaults.js';
|
|
39
|
+
import {equals} from './array.js';
|
|
39
40
|
import {fromUserCoordinate, toUserCoordinate} from './proj.js';
|
|
40
41
|
import {getUid} from './util.js';
|
|
41
42
|
import {hasArea} from './size.js';
|
|
42
43
|
import {listen, unlistenByKey} from './events.js';
|
|
43
44
|
import {removeNode} from './dom.js';
|
|
45
|
+
import {warn} from './console.js';
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
48
|
* State of the current frame. Only `pixelRatio`, `time` and `viewState` should
|
|
@@ -145,6 +147,7 @@ import {removeNode} from './dom.js';
|
|
|
145
147
|
* element itself or the `id` of the element. If not specified at construction
|
|
146
148
|
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
|
|
147
149
|
* rendered. If passed by element, the container can be in a secondary document.
|
|
150
|
+
* **Note:** CSS `transform` support for the target element is limited to `scale`.
|
|
148
151
|
* @property {View|Promise<import("./View.js").ViewOptions>} [view] The map's view. No layer sources will be
|
|
149
152
|
* fetched unless this is specified at construction time or through
|
|
150
153
|
* {@link module:ol/Map~Map#setView}.
|
|
@@ -185,10 +188,10 @@ function setLayerMapProperty(layer, map) {
|
|
|
185
188
|
* The map is the core component of OpenLayers. For a map to render, a view,
|
|
186
189
|
* one or more layers, and a target container are needed:
|
|
187
190
|
*
|
|
188
|
-
* import Map from 'ol/Map';
|
|
189
|
-
* import View from 'ol/View';
|
|
190
|
-
* import TileLayer from 'ol/layer/Tile';
|
|
191
|
-
* import OSM from 'ol/source/OSM';
|
|
191
|
+
* import Map from 'ol/Map.js';
|
|
192
|
+
* import View from 'ol/View.js';
|
|
193
|
+
* import TileLayer from 'ol/layer/Tile.js';
|
|
194
|
+
* import OSM from 'ol/source/OSM.js';
|
|
192
195
|
*
|
|
193
196
|
* const map = new Map({
|
|
194
197
|
* view: new View({
|
|
@@ -417,6 +420,17 @@ class Map extends BaseObject {
|
|
|
417
420
|
*/
|
|
418
421
|
this.targetChangeHandlerKeys_ = null;
|
|
419
422
|
|
|
423
|
+
/**
|
|
424
|
+
* @private
|
|
425
|
+
* @type {HTMLElement|null}
|
|
426
|
+
*/
|
|
427
|
+
this.targetElement_ = null;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @type {ResizeObserver}
|
|
431
|
+
*/
|
|
432
|
+
this.resizeObserver_ = new ResizeObserver(() => this.updateSize());
|
|
433
|
+
|
|
420
434
|
/**
|
|
421
435
|
* @type {Collection<import("./control/Control.js").default>}
|
|
422
436
|
* @protected
|
|
@@ -491,9 +505,9 @@ class Map extends BaseObject {
|
|
|
491
505
|
/**
|
|
492
506
|
* @param {import("./Collection.js").CollectionEvent<import("./control/Control.js").default>} event CollectionEvent
|
|
493
507
|
*/
|
|
494
|
-
|
|
508
|
+
(event) => {
|
|
495
509
|
event.element.setMap(this);
|
|
496
|
-
}
|
|
510
|
+
}
|
|
497
511
|
);
|
|
498
512
|
|
|
499
513
|
this.controls.addEventListener(
|
|
@@ -501,9 +515,9 @@ class Map extends BaseObject {
|
|
|
501
515
|
/**
|
|
502
516
|
* @param {import("./Collection.js").CollectionEvent<import("./control/Control.js").default>} event CollectionEvent.
|
|
503
517
|
*/
|
|
504
|
-
|
|
518
|
+
(event) => {
|
|
505
519
|
event.element.setMap(null);
|
|
506
|
-
}
|
|
520
|
+
}
|
|
507
521
|
);
|
|
508
522
|
|
|
509
523
|
this.interactions.addEventListener(
|
|
@@ -511,9 +525,9 @@ class Map extends BaseObject {
|
|
|
511
525
|
/**
|
|
512
526
|
* @param {import("./Collection.js").CollectionEvent<import("./interaction/Interaction.js").default>} event CollectionEvent.
|
|
513
527
|
*/
|
|
514
|
-
|
|
528
|
+
(event) => {
|
|
515
529
|
event.element.setMap(this);
|
|
516
|
-
}
|
|
530
|
+
}
|
|
517
531
|
);
|
|
518
532
|
|
|
519
533
|
this.interactions.addEventListener(
|
|
@@ -521,9 +535,9 @@ class Map extends BaseObject {
|
|
|
521
535
|
/**
|
|
522
536
|
* @param {import("./Collection.js").CollectionEvent<import("./interaction/Interaction.js").default>} event CollectionEvent.
|
|
523
537
|
*/
|
|
524
|
-
|
|
538
|
+
(event) => {
|
|
525
539
|
event.element.setMap(null);
|
|
526
|
-
}
|
|
540
|
+
}
|
|
527
541
|
);
|
|
528
542
|
|
|
529
543
|
this.overlays_.addEventListener(
|
|
@@ -531,9 +545,9 @@ class Map extends BaseObject {
|
|
|
531
545
|
/**
|
|
532
546
|
* @param {import("./Collection.js").CollectionEvent<import("./Overlay.js").default>} event CollectionEvent.
|
|
533
547
|
*/
|
|
534
|
-
|
|
548
|
+
(event) => {
|
|
535
549
|
this.addOverlayInternal_(event.element);
|
|
536
|
-
}
|
|
550
|
+
}
|
|
537
551
|
);
|
|
538
552
|
|
|
539
553
|
this.overlays_.addEventListener(
|
|
@@ -541,33 +555,31 @@ class Map extends BaseObject {
|
|
|
541
555
|
/**
|
|
542
556
|
* @param {import("./Collection.js").CollectionEvent<import("./Overlay.js").default>} event CollectionEvent.
|
|
543
557
|
*/
|
|
544
|
-
|
|
558
|
+
(event) => {
|
|
545
559
|
const id = event.element.getId();
|
|
546
560
|
if (id !== undefined) {
|
|
547
561
|
delete this.overlayIdIndex_[id.toString()];
|
|
548
562
|
}
|
|
549
563
|
event.element.setMap(null);
|
|
550
|
-
}
|
|
564
|
+
}
|
|
551
565
|
);
|
|
552
566
|
|
|
553
567
|
this.controls.forEach(
|
|
554
568
|
/**
|
|
555
569
|
* @param {import("./control/Control.js").default} control Control.
|
|
556
|
-
* @this {Map}
|
|
557
570
|
*/
|
|
558
|
-
|
|
571
|
+
(control) => {
|
|
559
572
|
control.setMap(this);
|
|
560
|
-
}
|
|
573
|
+
}
|
|
561
574
|
);
|
|
562
575
|
|
|
563
576
|
this.interactions.forEach(
|
|
564
577
|
/**
|
|
565
578
|
* @param {import("./interaction/Interaction.js").default} interaction Interaction.
|
|
566
|
-
* @this {Map}
|
|
567
579
|
*/
|
|
568
|
-
|
|
580
|
+
(interaction) => {
|
|
569
581
|
interaction.setMap(this);
|
|
570
|
-
}
|
|
582
|
+
}
|
|
571
583
|
);
|
|
572
584
|
|
|
573
585
|
this.overlays_.forEach(this.addOverlayInternal_.bind(this));
|
|
@@ -645,6 +657,7 @@ class Map extends BaseObject {
|
|
|
645
657
|
this.controls.clear();
|
|
646
658
|
this.interactions.clear();
|
|
647
659
|
this.overlays_.clear();
|
|
660
|
+
this.resizeObserver_.disconnect();
|
|
648
661
|
this.setTarget(null);
|
|
649
662
|
super.disposeInternal();
|
|
650
663
|
}
|
|
@@ -780,12 +793,16 @@ class Map extends BaseObject {
|
|
|
780
793
|
|
|
781
794
|
/**
|
|
782
795
|
* Returns the map pixel position for a browser event relative to the viewport.
|
|
783
|
-
* @param {UIEvent} event Event.
|
|
796
|
+
* @param {UIEvent|{clientX: number, clientY: number}} event Event.
|
|
784
797
|
* @return {import("./pixel.js").Pixel} Pixel.
|
|
785
798
|
* @api
|
|
786
799
|
*/
|
|
787
800
|
getEventPixel(event) {
|
|
788
|
-
const
|
|
801
|
+
const viewport = this.viewport_;
|
|
802
|
+
const viewportPosition = viewport.getBoundingClientRect();
|
|
803
|
+
const viewportSize = this.getSize();
|
|
804
|
+
const scaleX = viewportPosition.width / viewportSize[0];
|
|
805
|
+
const scaleY = viewportPosition.height / viewportSize[1];
|
|
789
806
|
const eventPosition =
|
|
790
807
|
//FIXME Are we really calling this with a TouchEvent anywhere?
|
|
791
808
|
'changedTouches' in event
|
|
@@ -793,8 +810,8 @@ class Map extends BaseObject {
|
|
|
793
810
|
: /** @type {MouseEvent} */ (event);
|
|
794
811
|
|
|
795
812
|
return [
|
|
796
|
-
eventPosition.clientX - viewportPosition.left,
|
|
797
|
-
eventPosition.clientY - viewportPosition.top,
|
|
813
|
+
(eventPosition.clientX - viewportPosition.left) / scaleX,
|
|
814
|
+
(eventPosition.clientY - viewportPosition.top) / scaleY,
|
|
798
815
|
];
|
|
799
816
|
}
|
|
800
817
|
|
|
@@ -821,13 +838,7 @@ class Map extends BaseObject {
|
|
|
821
838
|
* @api
|
|
822
839
|
*/
|
|
823
840
|
getTargetElement() {
|
|
824
|
-
|
|
825
|
-
if (target !== undefined) {
|
|
826
|
-
return typeof target === 'string'
|
|
827
|
-
? document.getElementById(target)
|
|
828
|
-
: target;
|
|
829
|
-
}
|
|
830
|
-
return null;
|
|
841
|
+
return this.targetElement_;
|
|
831
842
|
}
|
|
832
843
|
|
|
833
844
|
/**
|
|
@@ -1242,12 +1253,23 @@ class Map extends BaseObject {
|
|
|
1242
1253
|
removeNode(this.viewport_);
|
|
1243
1254
|
}
|
|
1244
1255
|
|
|
1256
|
+
if (this.targetElement_) {
|
|
1257
|
+
this.resizeObserver_.unobserve(this.targetElement_);
|
|
1258
|
+
const rootNode = this.targetElement_.getRootNode();
|
|
1259
|
+
if (rootNode instanceof ShadowRoot) {
|
|
1260
|
+
this.resizeObserver_.unobserve(rootNode.host);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1245
1264
|
// target may be undefined, null, a string or an Element.
|
|
1246
1265
|
// If it's a string we convert it to an Element before proceeding.
|
|
1247
1266
|
// If it's not now an Element we remove the viewport from the DOM.
|
|
1248
1267
|
// If it's an Element we append the viewport element to it.
|
|
1249
1268
|
|
|
1250
|
-
const
|
|
1269
|
+
const target = this.getTarget();
|
|
1270
|
+
const targetElement =
|
|
1271
|
+
typeof target === 'string' ? document.getElementById(target) : target;
|
|
1272
|
+
this.targetElement_ = targetElement;
|
|
1251
1273
|
if (!targetElement) {
|
|
1252
1274
|
if (this.renderer_) {
|
|
1253
1275
|
clearTimeout(this.postRenderTimeoutHandle_);
|
|
@@ -1287,7 +1309,6 @@ class Map extends BaseObject {
|
|
|
1287
1309
|
PASSIVE_EVENT_LISTENERS ? {passive: false} : false
|
|
1288
1310
|
);
|
|
1289
1311
|
|
|
1290
|
-
const defaultView = this.getOwnerDocument().defaultView;
|
|
1291
1312
|
const keyboardEventTarget = !this.keyboardEventTarget_
|
|
1292
1313
|
? targetElement
|
|
1293
1314
|
: this.keyboardEventTarget_;
|
|
@@ -1304,8 +1325,12 @@ class Map extends BaseObject {
|
|
|
1304
1325
|
this.handleBrowserEvent,
|
|
1305
1326
|
this
|
|
1306
1327
|
),
|
|
1307
|
-
listen(defaultView, EventType.RESIZE, this.updateSize, this),
|
|
1308
1328
|
];
|
|
1329
|
+
const rootNode = targetElement.getRootNode();
|
|
1330
|
+
if (rootNode instanceof ShadowRoot) {
|
|
1331
|
+
this.resizeObserver_.observe(rootNode.host);
|
|
1332
|
+
}
|
|
1333
|
+
this.resizeObserver_.observe(targetElement);
|
|
1309
1334
|
}
|
|
1310
1335
|
|
|
1311
1336
|
this.updateSize();
|
|
@@ -1555,7 +1580,7 @@ class Map extends BaseObject {
|
|
|
1555
1580
|
const moveStart =
|
|
1556
1581
|
!this.previousExtent_ ||
|
|
1557
1582
|
(!isEmpty(this.previousExtent_) &&
|
|
1558
|
-
!
|
|
1583
|
+
!equalsExtent(frameState.extent, this.previousExtent_));
|
|
1559
1584
|
if (moveStart) {
|
|
1560
1585
|
this.dispatchEvent(
|
|
1561
1586
|
new MapEvent(MapEventType.MOVESTART, this, previousFrameState)
|
|
@@ -1568,7 +1593,7 @@ class Map extends BaseObject {
|
|
|
1568
1593
|
this.previousExtent_ &&
|
|
1569
1594
|
!frameState.viewHints[ViewHint.ANIMATING] &&
|
|
1570
1595
|
!frameState.viewHints[ViewHint.INTERACTING] &&
|
|
1571
|
-
!
|
|
1596
|
+
!equalsExtent(frameState.extent, this.previousExtent_);
|
|
1572
1597
|
|
|
1573
1598
|
if (idle) {
|
|
1574
1599
|
this.dispatchEvent(
|
|
@@ -1687,16 +1712,18 @@ class Map extends BaseObject {
|
|
|
1687
1712
|
targetElement.getClientRects().length
|
|
1688
1713
|
)
|
|
1689
1714
|
) {
|
|
1690
|
-
|
|
1691
|
-
console.warn(
|
|
1715
|
+
warn(
|
|
1692
1716
|
"No map visible because the map container's width or height are 0."
|
|
1693
1717
|
);
|
|
1694
1718
|
}
|
|
1695
1719
|
}
|
|
1696
1720
|
}
|
|
1697
1721
|
|
|
1698
|
-
this.
|
|
1699
|
-
|
|
1722
|
+
const oldSize = this.getSize();
|
|
1723
|
+
if (size && (!oldSize || !equals(size, oldSize))) {
|
|
1724
|
+
this.setSize(size);
|
|
1725
|
+
this.updateViewportSize_();
|
|
1726
|
+
}
|
|
1700
1727
|
}
|
|
1701
1728
|
|
|
1702
1729
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapBrowserEventHandler.d.ts","sourceRoot":"","sources":["MapBrowserEventHandler.js"],"names":[],"mappings":";AAaA;IACE;;;OAGG;IACH,iBAHW,OAAO,UAAU,EAAE,OAAO,sCAyGpC;IAnGC;;;;OAIG;IACH,aAAe;IAEf;;;OAGG;IACH,wBAAoB;IAEpB;;;OAGG;IACH,gBAFU,OAAO,CAEU;IAE3B;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,0BAA2B;IAE3B;;;OAGG;IACH,uBAAqE;IAErE;;;;;OAKG;IACH,cAAiB;IAIjB;;;OAGG;IACH,wBAAyB;IAEzB;;;OAGG;IACH,wBAAyB;IAEzB,sBAAuB;IAEvB;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,kCAA8B;IAE9B;;;OAGG;IACH,4BAKC;IAED;;OAEG;IACH,8BAA6D;IAS/D;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"MapBrowserEventHandler.d.ts","sourceRoot":"","sources":["MapBrowserEventHandler.js"],"names":[],"mappings":";AAaA;IACE;;;OAGG;IACH,iBAHW,OAAO,UAAU,EAAE,OAAO,sCAyGpC;IAnGC;;;;OAIG;IACH,aAAe;IAEf;;;OAGG;IACH,wBAAoB;IAEpB;;;OAGG;IACH,gBAFU,OAAO,CAEU;IAE3B;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,0BAA2B;IAE3B;;;OAGG;IACH,uBAAqE;IAErE;;;;;OAKG;IACH,cAAiB;IAIjB;;;OAGG;IACH,wBAAyB;IAEzB;;;OAGG;IACH,wBAAyB;IAEzB,sBAAuB;IAEvB;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,kCAA8B;IAE9B;;;OAGG;IACH,4BAKC;IAED;;OAEG;IACH,8BAA6D;IAS/D;;;;OAIG;IACH,sBA6BC;IAED;;;;;;OAMG;IACH,8BA0BC;IAED;;;;OAIG;IACH,yBAiCC;IAED;;;;;OAKG;IACH,6BAEC;IAED;;;;OAIG;IACH,2BA6DC;IAED;;;;OAIG;IACH,2BAiBC;IAED;;;;;OAKG;IACH,wBAWC;IAED;;;;;;;OAOG;IACH,yBAUC;IAED;;;;;OAKG;IACH,kBAOC;CA0BF"}
|
|
@@ -144,19 +144,15 @@ class MapBrowserEventHandler extends Target {
|
|
|
144
144
|
this.dispatchEvent(newEvent);
|
|
145
145
|
} else {
|
|
146
146
|
// click
|
|
147
|
-
this.clickTimeoutId_ = setTimeout(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.dispatchEvent(newEvent);
|
|
157
|
-
}.bind(this),
|
|
158
|
-
250
|
|
159
|
-
);
|
|
147
|
+
this.clickTimeoutId_ = setTimeout(() => {
|
|
148
|
+
this.clickTimeoutId_ = undefined;
|
|
149
|
+
const newEvent = new MapBrowserEvent(
|
|
150
|
+
MapBrowserEventType.SINGLECLICK,
|
|
151
|
+
this.map_,
|
|
152
|
+
pointerEvent
|
|
153
|
+
);
|
|
154
|
+
this.dispatchEvent(newEvent);
|
|
155
|
+
}, 250);
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
158
|
|
package/Overlay.d.ts
CHANGED
package/Overlay.js
CHANGED
package/README.md
CHANGED
|
@@ -76,7 +76,15 @@ OpenLayers appreciates contributions of all kinds. We especially want to thank
|
|
|
76
76
|
|
|
77
77
|
> We develop leading Physical Security Information Management (PSIM) software.
|
|
78
78
|
> OpenLayers is the core of our map engine and we love it!
|
|
79
|
-
> https://
|
|
79
|
+
> https://ela.pl/
|
|
80
|
+
|
|
81
|
+
<br>
|
|
82
|
+
|
|
83
|
+
[](https://www.ubigu.fi/)
|
|
84
|
+
|
|
85
|
+
> We advance holistic utilization and availability of spatial information,
|
|
86
|
+
> for a better planned, built and managed society.
|
|
87
|
+
> https://www.ubigu.fi/
|
|
80
88
|
|
|
81
89
|
<br>
|
|
82
90
|
|
package/Tile.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default Tile;
|
|
|
11
11
|
* error handling:
|
|
12
12
|
*
|
|
13
13
|
* ```js
|
|
14
|
-
* import TileState from 'ol/TileState';
|
|
14
|
+
* import TileState from 'ol/TileState.js';
|
|
15
15
|
*
|
|
16
16
|
* source.setTileLoadFunction(function(tile, src) {
|
|
17
17
|
* const xhr = new XMLHttpRequest();
|
|
@@ -68,7 +68,7 @@ export type Options = {
|
|
|
68
68
|
* error handling:
|
|
69
69
|
*
|
|
70
70
|
* ```js
|
|
71
|
-
* import TileState from 'ol/TileState';
|
|
71
|
+
* import TileState from 'ol/TileState.js';
|
|
72
72
|
*
|
|
73
73
|
* source.setTileLoadFunction(function(tile, src) {
|
|
74
74
|
* const xhr = new XMLHttpRequest();
|
package/Tile.js
CHANGED
package/TileCache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileCache.d.ts","sourceRoot":"","sources":["TileCache.js"],"names":[],"mappings":";AAMA;IAuBM,
|
|
1
|
+
{"version":3,"file":"TileCache.d.ts","sourceRoot":"","sources":["TileCache.js"],"names":[],"mappings":";AAMA;IAuBM,gDAmB8M;IAlClN;;OAEG;IACH;YAFmB,MAAM,GAAE,OAAO;aAWjC;IAED;;OAEG;IACH,2BAaC;CACF"}
|
package/TileCache.js
CHANGED
|
@@ -36,14 +36,12 @@ class TileCache extends LRUCache {
|
|
|
36
36
|
const key = this.peekFirstKey();
|
|
37
37
|
const tileCoord = fromKey(key);
|
|
38
38
|
const z = tileCoord[0];
|
|
39
|
-
this.forEach(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}.bind(this)
|
|
46
|
-
);
|
|
39
|
+
this.forEach((tile) => {
|
|
40
|
+
if (tile.tileCoord[0] !== z) {
|
|
41
|
+
this.remove(getKey(tile.tileCoord));
|
|
42
|
+
tile.release();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
|
package/array.d.ts
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export function binarySearch(haystack: Array<any>, needle: any, comparator?: Function | undefined): number;
|
|
14
14
|
/**
|
|
15
|
-
* Compare function
|
|
15
|
+
* Compare function sorting arrays in ascending order. Safe to use for numeric values.
|
|
16
16
|
* @param {*} a The first object to be compared.
|
|
17
17
|
* @param {*} b The second object to be compared.
|
|
18
18
|
* @return {number} A negative number, zero, or a positive number as the first
|
|
19
19
|
* argument is less than, equal to, or greater than the second.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
21
|
+
export function ascending(a: any, b: any): number;
|
|
22
22
|
/**
|
|
23
23
|
* {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution} can use a function
|
|
24
24
|
* of this type to determine which nearest resolution to use.
|
package/array.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["array.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;GAQG;AACH,uCALW,UAAQ,mDAGP,MAAM,CA2BjB;AAED;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["array.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;GAQG;AACH,uCALW,UAAQ,mDAGP,MAAM,CA2BjB;AAED;;;;;;GAMG;AACH,2CAHY,MAAM,CAKjB;AAED;;;;;;;;;;;;GAYG;AAEH;;;;;;;;GAQG;AACH,uCARW,MAAM,MAAM,CAAC,UACb,MAAM,aACN,MAAM,GAAC,wBAAwB,GAI9B,MAAM,CAwCjB;AAED;;;;GAIG;AACH,qCAJW,UAAQ,SACR,MAAM,OACN,MAAM,QAUhB;AAED;;;;GAIG;AACH,yEAMC;AAED;;;;;GAKG;AACH,yDAFY,OAAO,CASlB;AAED;;;;GAIG;AACH,6BAJW,QAAM,iBAAiB,QACvB,QAAM,iBAAiB,GACtB,OAAO,CAalB;AAED;;;;;;GAMG;AACH,gCAJW,UAAQ,wCACS,MAAM,QAgBjC;AAED;;;;;GAKG;AACH,8BALW,UAAQ,8DAGP,OAAO,CAWlB;;;;;;;;;;;;8CAvJqB,MAAM,QAAE,MAAM,QAAE,MAAM,KAAG,MAAM"}
|
package/array.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export function binarySearch(haystack, needle, comparator) {
|
|
15
15
|
let mid, cmp;
|
|
16
|
-
comparator = comparator ||
|
|
16
|
+
comparator = comparator || ascending;
|
|
17
17
|
let low = 0;
|
|
18
18
|
let high = haystack.length;
|
|
19
19
|
let found = false;
|
|
@@ -39,13 +39,13 @@ export function binarySearch(haystack, needle, comparator) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Compare function
|
|
42
|
+
* Compare function sorting arrays in ascending order. Safe to use for numeric values.
|
|
43
43
|
* @param {*} a The first object to be compared.
|
|
44
44
|
* @param {*} b The second object to be compared.
|
|
45
45
|
* @return {number} A negative number, zero, or a positive number as the first
|
|
46
46
|
* argument is less than, equal to, or greater than the second.
|
|
47
47
|
*/
|
|
48
|
-
export function
|
|
48
|
+
export function ascending(a, b) {
|
|
49
49
|
return a > b ? 1 : a < b ? -1 : 0;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -202,7 +202,7 @@ export function stableSort(arr, compareFnc) {
|
|
|
202
202
|
* @return {boolean} Return index.
|
|
203
203
|
*/
|
|
204
204
|
export function isSorted(arr, func, strict) {
|
|
205
|
-
const compare = func ||
|
|
205
|
+
const compare = func || ascending;
|
|
206
206
|
return arr.every(function (currentVal, index) {
|
|
207
207
|
if (index === 0) {
|
|
208
208
|
return true;
|
package/console.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set the logging level. By default, the level is set to 'info' and all
|
|
3
|
+
* messages will be logged. Set to 'warn' to only display warnings and errors.
|
|
4
|
+
* Set to 'error' to only display errors. Set to 'none' to silence all messages.
|
|
5
|
+
*
|
|
6
|
+
* @param {Level} l The new level.
|
|
7
|
+
*/
|
|
8
|
+
export function setLevel(l: Level): void;
|
|
9
|
+
export function log(...args: any[]): void;
|
|
10
|
+
export function warn(...args: any[]): void;
|
|
11
|
+
export function error(...args: any[]): void;
|
|
12
|
+
export type Level = 'info' | 'warn' | 'error' | 'none';
|
|
13
|
+
//# sourceMappingURL=console.d.ts.map
|
package/console.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["console.js"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,4BAFW,KAAK,QAIf;AAED,0CAKC;AAED,2CAKC;AAED,4CAKC;oBAhDY,MAAM,GAAC,MAAM,GAAC,OAAO,GAAC,MAAM"}
|
package/console.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ol/console
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {'info'|'warn'|'error'|'none'} Level
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {Object<Level, number>}
|
|
11
|
+
*/
|
|
12
|
+
const levels = {
|
|
13
|
+
info: 1,
|
|
14
|
+
warn: 2,
|
|
15
|
+
error: 3,
|
|
16
|
+
none: 4,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
let level = levels.info;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Set the logging level. By default, the level is set to 'info' and all
|
|
26
|
+
* messages will be logged. Set to 'warn' to only display warnings and errors.
|
|
27
|
+
* Set to 'error' to only display errors. Set to 'none' to silence all messages.
|
|
28
|
+
*
|
|
29
|
+
* @param {Level} l The new level.
|
|
30
|
+
*/
|
|
31
|
+
export function setLevel(l) {
|
|
32
|
+
level = levels[l];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function log(...args) {
|
|
36
|
+
if (level > levels.info) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
console.log(...args); // eslint-disable-line no-console
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function warn(...args) {
|
|
43
|
+
if (level > levels.warn) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
console.warn(...args); // eslint-disable-line no-console
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function error(...args) {
|
|
50
|
+
if (level > levels.error) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
console.error(...args); // eslint-disable-line no-console
|
|
54
|
+
}
|
|
@@ -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":";;;;+
|
|
1
|
+
{"version":3,"file":"MousePosition.d.ts","sourceRoot":"","sources":["MousePosition.js"],"names":[],"mappings":";;;;+CA2Ba,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;;;;;;;;;;;;;;;;;;;;AAd7D;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;;;GAWG;AACH;IACE;;OAEG;IACH,2CAwEC;IA3DC;;OAEG;IACH,IAFU,yBAAyB,OAAO,WAAW,EAAE,SAAS,CAAC,CAE1D;IAEP;;OAEG;IACH,MAFU,yBAAyB,OAAO,WAAW,EAAE,SAAS,CAAC,CAExD;IAET;;OAEG;IACH,IAFU,yBAAyB,IAAI,CAAC,CAEjC;IAWP;;;OAGG;IACH,0BAA0D;IAE1D;;;OAGG;IACH,qBAA2E;IAE3E;;;OAGG;IACH,sBAAsC;IAEtC;;;OAGG;IACH,uBAA0B;IAE1B;;;OAGG;IACH,mBAAsB;IAEtB;;;OAGG;IACH,eAAoD;IAGtD;;OAEG;IACH,iCAEC;IAED;;;;;;;OAOG;IACH,uBALY,OAAO,kBAAkB,EAAE,gBAAgB,GAAC,SAAS,CAShE;IAED;;;;;;OAMG;IACH,iBALY,OAAO,uBAAuB,EAAE,OAAO,GAAC,SAAS,CAS5D;IAED;;;OAGG;IACH,iCAHW,UAAU,QAMpB;IAED;;;OAGG;IACH,gCAHW,KAAK,QAKf;IA0BD;;;;;;OAMG;IACH,4BALW,OAAO,kBAAkB,EAAE,gBAAgB,QAOrD;IAED;;;;;;OAMG;IACH,0BALW,OAAO,YAAY,EAAE,cAAc,QAO7C;IAED;;;OAGG;IACH,oBA0CC;CAmBF"}
|
package/control/MousePosition.js
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
identityTransform,
|
|
12
12
|
} from '../proj.js';
|
|
13
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);
|