diff --git a/frontend/src/features/InterestPoint/layers/InterestPointLayer.tsx b/frontend/src/features/InterestPoint/layers/InterestPointLayer.tsx index fbb2b5ff67..fdb99e052e 100644 --- a/frontend/src/features/InterestPoint/layers/InterestPointLayer.tsx +++ b/frontend/src/features/InterestPoint/layers/InterestPointLayer.tsx @@ -12,7 +12,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { v4 as uuidv4 } from 'uuid' import { getInterestPointStyle, POIStyle } from './interestPoint.style' -import { InterestPointLine } from './interestPointLine' +import { InterestPointLine } from './InterestPointLine' import { LayerProperties } from '../../../domain/entities/layers/constants' import { MapBox, OPENLAYERS_PROJECTION } from '../../../domain/entities/map/constants' import { setRightMapBoxOpened } from '../../../domain/shared_slices/Global' diff --git a/frontend/src/features/InterestPoint/layers/interestPointLine.js b/frontend/src/features/InterestPoint/layers/InterestPointLine.ts similarity index 55% rename from frontend/src/features/InterestPoint/layers/interestPointLine.js rename to frontend/src/features/InterestPoint/layers/InterestPointLine.ts index aa6374fa32..bac6ad30ed 100644 --- a/frontend/src/features/InterestPoint/layers/interestPointLine.js +++ b/frontend/src/features/InterestPoint/layers/InterestPointLine.ts @@ -4,14 +4,18 @@ import LineString from 'ol/geom/LineString' export class InterestPointLine { static typeProperty = 'type' static isHiddenByZoomProperty = 'isHiddenByZoom' + /** * InterestPointLine object for building OpenLayers interest point line to draggable overlay - * @param {string[]} fromCoordinates - The [longitude, latitude] of the start of the line (the interest point position) - * @param {string[]} toCoordinates - The [longitude, latitude] of the overlay position - * @param {string} featureId - The feature identifier + * + * @param fromCoordinates - The [longitude, latitude] of the start of the line (the interest point position) + * @param toCoordinates - The [longitude, latitude] of the overlay position + * @param featureId - The feature identifier */ - static getFeature(fromCoordinates, toCoordinates, featureId) { + static getFeature(fromCoordinates: string[], toCoordinates: string[], featureId: string) { const interestPointLineFeature = new Feature({ + // TODO Fix that: `ype 'string[]' is not assignable to type 'number | Coordinate'.`. Legacy code. + // @ts-ignore geometry: new LineString([fromCoordinates, toCoordinates]) }) diff --git a/frontend/src/features/InterestPoint/layers/interestPoint.style.tsx b/frontend/src/features/InterestPoint/layers/interestPoint.style.tsx index f9b452852c..9f3a3ffc29 100644 --- a/frontend/src/features/InterestPoint/layers/interestPoint.style.tsx +++ b/frontend/src/features/InterestPoint/layers/interestPoint.style.tsx @@ -4,7 +4,7 @@ import CircleStyle from 'ol/style/Circle' import Fill from 'ol/style/Fill' import Stroke from 'ol/style/Stroke' -import { InterestPointLine } from './interestPointLine' +import { InterestPointLine } from './InterestPointLine' import { INTEREST_POINT_STYLE, InterestPointType } from '../utils' const interestPointStylesCache = new Map()