Skip to content

Commit d74591a

Browse files
committed
Website updates
1 parent ca67b7a commit d74591a

File tree

9 files changed

+57
-21
lines changed

9 files changed

+57
-21
lines changed

dist/en/main/apidoc/module-ol_interaction_Draw-Draw.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ <h4 class="name">
977977

978978
<div class="tag-source">
979979
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
980-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1745">line 1745</a>
980+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1767">line 1767</a>
981981
</div>
982982

983983
</div>
@@ -1058,7 +1058,7 @@ <h4 class="name">
10581058

10591059
<div class="tag-source">
10601060
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
1061-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1761">line 1761</a>
1061+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1783">line 1783</a>
10621062
</div>
10631063

10641064
</div>
@@ -1414,7 +1414,7 @@ <h4 class="name">
14141414

14151415
<div class="tag-source">
14161416
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
1417-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1810">line 1810</a>
1417+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1832">line 1832</a>
14181418
</div>
14191419

14201420
</div>
@@ -1545,7 +1545,7 @@ <h4 class="name">
15451545

15461546
<div class="tag-source">
15471547
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
1548-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1678">line 1678</a>
1548+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1700">line 1700</a>
15491549
</div>
15501550

15511551
</div>
@@ -2050,7 +2050,7 @@ <h4 class="name">
20502050

20512051
<div class="tag-source">
20522052
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
2053-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L980">line 980</a>
2053+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L989">line 989</a>
20542054
</div>
20552055

20562056
</div>
@@ -2418,7 +2418,7 @@ <h4 class="name">
24182418

24192419
<div class="tag-source">
24202420
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
2421-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L991">line 991</a>
2421+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1000">line 1000</a>
24222422
</div>
24232423

24242424
</div>
@@ -2887,7 +2887,7 @@ <h4 class="name">
28872887

28882888
<div class="tag-source">
28892889
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
2890-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1667">line 1667</a>
2890+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1689">line 1689</a>
28912891
</div>
28922892

28932893
</div>

dist/en/main/apidoc/module-ol_interaction_Draw.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ <h4 class="name">
207207

208208
<div class="tag-source">
209209
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
210-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1922">line 1922</a>
210+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1944">line 1944</a>
211211
</div>
212212

213213
</div>
@@ -302,7 +302,7 @@ <h4 class="name">
302302

303303
<div class="tag-source">
304304
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
305-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1881">line 1881</a>
305+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Draw.js#L1903">line 1903</a>
306306
</div>
307307

308308
</div>

dist/en/main/examples/common.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/interaction/Draw.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ declare class Draw extends PointerInteraction {
360360
* @private
361361
*/
362362
private stopClick_;
363+
/**
364+
* Ignore the next up event. This is set to `true` when a drag event is encountered,
365+
* e.g. when the user pans the map while drawing. In this case, we do not want to bail
366+
* out of tracing.
367+
* @type {boolean}
368+
* @private
369+
*/
370+
private ignoreNextUpEvent_;
363371
/**
364372
* The number of points that must be drawn before a polygon ring or line
365373
* string can be finished. The default is 3 for polygon rings and 2 for
@@ -549,6 +557,12 @@ declare class Draw extends PointerInteraction {
549557
* @private
550558
*/
551559
private updateTrace_;
560+
/**
561+
* Handle drag events.
562+
* @param {import("../MapBrowserEvent.js").default<PointerEvent>} event Event.
563+
* @override
564+
*/
565+
override handleDragEvent(event: import("../MapBrowserEvent.js").default<PointerEvent>): void;
552566
/**
553567
* Handle pointer up events.
554568
* @param {import("../MapBrowserEvent.js").default<PointerEvent>} event Event.

dist/en/main/ol/interaction/Draw.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/interaction/Draw.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,15 @@ class Draw extends PointerInteraction {
702702
*/
703703
this.stopClick_ = !!options.stopClick;
704704

705+
/**
706+
* Ignore the next up event. This is set to `true` when a drag event is encountered,
707+
* e.g. when the user pans the map while drawing. In this case, we do not want to bail
708+
* out of tracing.
709+
* @type {boolean}
710+
* @private
711+
*/
712+
this.ignoreNextUpEvent_ = false;
713+
705714
/**
706715
* The number of points that must be drawn before a polygon ring or line
707716
* string can be finished. The default is 3 for polygon rings and 2 for
@@ -1299,6 +1308,16 @@ class Draw extends PointerInteraction {
12991308
event.pixel = [Math.round(pixel[0]), Math.round(pixel[1])];
13001309
}
13011310

1311+
/**
1312+
* Handle drag events.
1313+
* @param {import("../MapBrowserEvent.js").default<PointerEvent>} event Event.
1314+
* @override
1315+
*/
1316+
handleDragEvent(event) {
1317+
this.ignoreNextUpEvent_ = true;
1318+
super.handleDragEvent(event);
1319+
}
1320+
13021321
/**
13031322
* Handle pointer up events.
13041323
* @param {import("../MapBrowserEvent.js").default<PointerEvent>} event Event.
@@ -1316,7 +1335,9 @@ class Draw extends PointerInteraction {
13161335

13171336
this.handlePointerMove_(event);
13181337
const tracing = this.traceState_.active;
1319-
this.toggleTraceState_(event);
1338+
if (!this.ignoreNextUpEvent_) {
1339+
this.toggleTraceState_(event);
1340+
}
13201341

13211342
if (this.shouldHandle_) {
13221343
const startingToDraw = !this.finishCoordinate_;
@@ -1342,6 +1363,7 @@ class Draw extends PointerInteraction {
13421363
this.abortDrawing();
13431364
}
13441365
}
1366+
this.ignoreNextUpEvent_ = false;
13451367

13461368
if (!pass && this.stopClick_) {
13471369
event.preventDefault();

0 commit comments

Comments
 (0)