@@ -81,21 +81,21 @@ export function recursivelyTraverseNestedArrays(
8181export function generatePointsParallelToLinePoints (
8282 p1 : Position ,
8383 p2 : Position ,
84- mapCoords : Position
84+ coords : Position
8585) : Position [ ] {
8686 const lineString : LineString = {
8787 type : 'LineString' ,
8888 coordinates : [ p1 , p2 ]
8989 } ;
90- const pt = point ( mapCoords ) ;
90+ const pt = point ( coords ) ;
9191 const ddistance = pointToLineDistance ( pt , lineString ) ;
9292 const lineBearing = bearing ( p1 , p2 ) ;
9393
9494 // Check if current point is to the left or right of line
9595 // Line from A=(x1,y1) to B=(x2,y2) a point P=(x,y)
9696 // then (x−x1)(y2−y1)−(y−y1)(x2−x1)
9797 const isPointToLeftOfLine =
98- ( mapCoords [ 0 ] - p1 [ 0 ] ) * ( p2 [ 1 ] - p1 [ 1 ] ) - ( mapCoords [ 1 ] - p1 [ 1 ] ) * ( p2 [ 0 ] - p1 [ 0 ] ) ;
98+ ( coords [ 0 ] - p1 [ 0 ] ) * ( p2 [ 1 ] - p1 [ 1 ] ) - ( coords [ 1 ] - p1 [ 1 ] ) * ( p2 [ 0 ] - p1 [ 0 ] ) ;
9999
100100 // Bearing to draw perpendicular to the line string
101101 const orthogonalBearing = isPointToLeftOfLine < 0 ? lineBearing - 90 : lineBearing - 270 ;
@@ -470,21 +470,21 @@ function getEditHandlesForCoordinates(
470470 * Calculates coordinates for a feature preserving rectangular shape.
471471 * @param feature Feature before modification.
472472 * @param editHandleIndex Index of the point to modify.
473- * @param mapCoords New position for the point.
473+ * @param coords New position for the point.
474474 * @returns Updated coordinates.
475475 */
476476export function updateRectanglePosition (
477477 feature : FeatureOf < Polygon > ,
478478 editHandleIndex : number ,
479- mapCoords : Position
479+ coords : Position
480480) : Position [ ] [ ] | null {
481481 const coordinates = feature . geometry . coordinates ;
482482 if ( ! coordinates ) {
483483 return null ;
484484 }
485485
486486 const points = coordinates [ 0 ] . slice ( 0 , 4 ) ;
487- points [ editHandleIndex % 4 ] = mapCoords ;
487+ points [ editHandleIndex % 4 ] = coords ;
488488
489489 const p0 = points [ ( editHandleIndex + 2 ) % 4 ] ;
490490 const p2 = points [ editHandleIndex % 4 ] ;
0 commit comments