Skip to content

Commit 7c15bdd

Browse files
committed
Website updates
1 parent 465ef5f commit 7c15bdd

7 files changed

Lines changed: 47 additions & 13 deletions

File tree

dist/en/main/apidoc/module-ol_interaction_Modify-Modify.html

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

794794
<div class="tag-source">
795795
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
796-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2138">line 2138</a>
796+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2172">line 2172</a>
797797
</div>
798798

799799
</div>
@@ -884,7 +884,7 @@ <h4 class="name">
884884

885885
<div class="tag-source">
886886
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
887-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1946">line 1946</a>
887+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1980">line 1980</a>
888888
</div>
889889

890890
</div>
@@ -1982,7 +1982,7 @@ <h4 class="name">
19821982

19831983
<div class="tag-source">
19841984
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
1985-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2171">line 2171</a>
1985+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2205">line 2205</a>
19861986
</div>
19871987

19881988
</div>
@@ -2452,7 +2452,7 @@ <h4 class="name">
24522452

24532453
<div class="tag-source">
24542454
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
2455-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1977">line 1977</a>
2455+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2011">line 2011</a>
24562456
</div>
24572457

24582458
</div>

dist/en/main/examples/common.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/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/Modify.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/Modify.js

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,16 +1481,50 @@ class Modify extends PointerInteraction {
14811481
coordinates[depth[0]][segmentData.index + index] = vertex;
14821482
segment[index] = vertex;
14831483
break;
1484-
case 'Polygon':
1484+
case 'Polygon': {
14851485
coordinates = geometry.getCoordinates();
1486-
coordinates[depth[0]][segmentData.index + index] = vertex;
1486+
const ring = coordinates[depth[0]];
1487+
const targetIndex = segmentData.index + index;
1488+
1489+
// Prevent duplicate change events when vertex already at position
1490+
if (
1491+
ring[targetIndex][0] === vertex[0] &&
1492+
ring[targetIndex][1] === vertex[1]
1493+
) {
1494+
coordinates = null;
1495+
} else {
1496+
ring[targetIndex] = vertex;
1497+
if (targetIndex === 0) {
1498+
ring[ring.length - 1] = vertex;
1499+
} else if (targetIndex === ring.length - 1) {
1500+
ring[0] = vertex;
1501+
}
1502+
}
14871503
segment[index] = vertex;
14881504
break;
1489-
case 'MultiPolygon':
1505+
}
1506+
case 'MultiPolygon': {
14901507
coordinates = geometry.getCoordinates();
1491-
coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;
1508+
const mRing = coordinates[depth[1]][depth[0]];
1509+
const mTargetIndex = segmentData.index + index;
1510+
1511+
// Prevent duplicate change events when vertex already at position
1512+
if (
1513+
mRing[mTargetIndex][0] === vertex[0] &&
1514+
mRing[mTargetIndex][1] === vertex[1]
1515+
) {
1516+
coordinates = null;
1517+
} else {
1518+
mRing[mTargetIndex] = vertex;
1519+
if (mTargetIndex === 0) {
1520+
mRing[mRing.length - 1] = vertex;
1521+
} else if (mTargetIndex === mRing.length - 1) {
1522+
mRing[0] = vertex;
1523+
}
1524+
}
14921525
segment[index] = vertex;
14931526
break;
1527+
}
14941528
case 'Circle':
14951529
const circle = /** @type {import("../geom/Circle.js").default} */ (
14961530
geometry

0 commit comments

Comments
 (0)