Skip to content

Commit

Permalink
fix: reduit le buffer autour de la parcelle
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoireDucharme committed Dec 17, 2024
1 parent dcfa7fb commit 82aee5c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ function onMapClickDivide(e) {
const hasFirstPoint = firstPoint.value.point != null;
if (
modifiedFeature.value.every(
(feature) => !turf.booleanPointInPolygon(clickedPoint, turf.buffer(feature, 15, { units: "meters" })),
(feature) => !turf.booleanPointInPolygon(clickedPoint, turf.buffer(feature, 5, { units: "meters" })),
)
) {
firstPoint.value.point = null;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ function onMapClickCutBorder(e) {
if (
modifiedFeature.value.every(
(feature) => !turf.booleanPointInPolygon(pointClickedPoint, turf.buffer(feature, 15, { units: "meters" })),
(feature) => !turf.booleanPointInPolygon(pointClickedPoint, turf.buffer(feature, 5, { units: "meters" })),
)
) {
return;
Expand All @@ -1413,7 +1413,7 @@ function onMapClickCutBorder(e) {
!dragStartBorderPoint.value &&
turf.booleanPointInPolygon(
pointClickedPoint,
turf.buffer(modifiedFeature.value[splitFeatureIndex.value], 15, { units: "meters" }),
turf.buffer(modifiedFeature.value[splitFeatureIndex.value], 5, { units: "meters" }),
)
) {
if (e.type === "mousedown") {
Expand Down Expand Up @@ -1492,7 +1492,7 @@ function onMapClickCutBorder(e) {
}
}
if (!turf.booleanPointInPolygon(pointClickedPoint, turf.buffer(feature, 15, { units: "meters" }))) {
if (!turf.booleanPointInPolygon(pointClickedPoint, turf.buffer(feature, 5, { units: "meters" }))) {
return;
}
Expand Down Expand Up @@ -2376,6 +2376,8 @@ async function saveFeature() {
}
statsPush(["trackEvent", "Parcelles", "Modification (tracé)"]);
if (history.value && history.value[0] && history.value[0][0] && history.value[0][0].id)
featuresStore.unselect(history.value[0][0].id);
await router.push(`/exploitations/${props.numeroBio}/${record.record_id}`);
const newIds = result.parcelles.features.filter((f) => !previousAll.some((pa) => pa === f.id)).map((f) => f.id);
Expand Down

0 comments on commit 82aee5c

Please sign in to comment.