Skip to content

Commit 80015b4

Browse files
committed
fix: linting
1 parent 074e77c commit 80015b4

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/Hooks/useDrawCut/useDrawCut.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ValidOp from 'jsts/org/locationtech/jts/operation/valid/IsValidOp';
1010

1111
import * as OlEventConditions from 'ol/events/condition';
1212
import OlFeature from 'ol/Feature';
13+
import OlGeometry from 'ol/geom/Geometry';
1314
import GeometryCollection from 'ol/geom/GeometryCollection';
1415
import LinearRing from 'ol/geom/LinearRing';
1516
import LineString from 'ol/geom/LineString';
@@ -18,7 +19,6 @@ import MultiPoint from 'ol/geom/MultiPoint';
1819
import MultiPolygon from 'ol/geom/MultiPolygon';
1920
import Point from 'ol/geom/Point';
2021
import Polygon from 'ol/geom/Polygon';
21-
import OlGeometry from 'ol/geom/Geometry';
2222
import OlInteractionDraw, {DrawEvent as OlDrawEvent} from 'ol/interaction/Draw';
2323
import OlVectorLayer from 'ol/layer/Vector';
2424
import OlSourceVector from 'ol/source/Vector';

src/Hooks/useMeasure/useMeasure.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export const useMeasure = ({
262262
const tooltip = stepMeasureTooltips.current.pop()!;
263263
map.removeOverlay(tooltip);
264264
}
265-
}, [map])
265+
}, [map]);
266266

267267
const removeSegmentMeasureTooltips = useCallback(() => {
268268
if (map && segmentMeasureTooltips.current.length > 0) {
@@ -296,7 +296,9 @@ export const useMeasure = ({
296296
removeSegmentDrawingMeasureTooltip();
297297
removeHelpTooltip();
298298
measureLayer?.getSource()?.clear();
299-
}, [measureLayer, removeMeasureTooltip, removeStepMeasureTooltips, removeSegmentMeasureTooltips, removeHelpTooltip]);
299+
}, [measureLayer, removeMeasureTooltip, removeStepMeasureTooltips, removeSegmentMeasureTooltips,
300+
removeHelpTooltip, removeSegmentDrawingMeasureTooltip
301+
]);
300302

301303
useEffect(() => {
302304
if (active) {
@@ -339,9 +341,9 @@ export const useMeasure = ({
339341
}
340342

341343
let value;
342-
let geom = simplifyFeatureGeom(feature);
344+
const geom = simplifyFeatureGeom(feature);
343345

344-
let measureTooltipCoord: OlCoordinate | undefined = undefined
346+
let measureTooltipCoord: OlCoordinate | undefined = undefined;
345347

346348
if (geom instanceof OlGeomCircle) {
347349
if (!measureRadius) {
@@ -390,7 +392,7 @@ export const useMeasure = ({
390392
}
391393

392394
tooltip.setPosition(measureTooltipCoord);
393-
}, [decimalPlacesInTooltips, feature, geodesic, map, measureType, measureRadius]);
395+
}, [decimalPlacesInTooltips, feature, geodesic, map, measureType, measureRadius, createTooltip, removeMeasureTooltip]);
394396

395397
const onDrawStart = useCallback((evt: OlDrawEvent) => {
396398
if (!map) {
@@ -409,7 +411,7 @@ export const useMeasure = ({
409411
return;
410412
}
411413

412-
let geom = simplifyFeatureGeom(feature);
414+
const geom = simplifyFeatureGeom(feature);
413415

414416
const value = measureType === 'line' ?
415417
MeasureUtil.formatLength(geom as OlGeomLineString, map, decimalPlacesInTooltips, geodesic) :
@@ -432,7 +434,7 @@ export const useMeasure = ({
432434
return;
433435
}
434436

435-
let geom = simplifyFeatureGeom(feature);
437+
const geom = simplifyFeatureGeom(feature);
436438

437439
let coordinates: OlCoordinate[] = [];
438440

@@ -483,7 +485,7 @@ export const useMeasure = ({
483485
return;
484486
}
485487

486-
let geom = simplifyFeatureGeom(feature);
488+
const geom = simplifyFeatureGeom(feature);
487489

488490
let coordinates: OlCoordinate[] = [];
489491

@@ -520,7 +522,7 @@ export const useMeasure = ({
520522

521523
tooltip.setPosition(coordinate);
522524
}
523-
}, [decimalPlacesInTooltips, feature, geodesic, map, createTooltip])
525+
}, [decimalPlacesInTooltips, feature, geodesic, map, createTooltip]);
524526

525527
const onDrawEnd = useCallback((evt: OlDrawEvent) => {
526528
if (!map) {
@@ -563,7 +565,7 @@ export const useMeasure = ({
563565
}
564566
}, [addMeasureStopTooltip, measureTooltipCssClasses, map,
565567
measureType, multipleDrawing, removeMeasureTooltip, showMeasureInfoOnClickedPoints, updateMeasureTooltip,
566-
showSegmentLengths, addSegmentTooltip, removeLastStepMeasureTooltip
568+
showSegmentLengths, addSegmentTooltip, removeLastStepMeasureTooltip, removeSegmentDrawingMeasureTooltip
567569
]);
568570

569571
const updateHelpTooltip = useCallback((coordinate: OlCoordinate) => {
@@ -607,7 +609,9 @@ export const useMeasure = ({
607609
if (active && showSegmentLengths && (measureType === 'line' || measureType === 'polygon')) {
608610
addSegmentTooltip();
609611
}
610-
}, [addMeasureStopTooltip, addSegmentTooltip, measureType, showMeasureInfoOnClickedPoints, showSegmentLengths, active]);
612+
}, [addMeasureStopTooltip, addSegmentTooltip, measureType, showMeasureInfoOnClickedPoints, showSegmentLengths,
613+
active
614+
]);
611615

612616
useOlListener(
613617
drawInteraction,

0 commit comments

Comments
 (0)