Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore]: Update Leaflet types #2923

Merged
merged 5 commits into from
Aug 21, 2024
Merged

[chore]: Update Leaflet types #2923

merged 5 commits into from
Aug 21, 2024

Conversation

alimpens
Copy link
Contributor

No description provided.

@alimpens alimpens requested a review from vdegraaf August 19, 2024 08:52
Comment on lines 11 to 17
const convertCoordsToLatLng = (coordinates: LatLngTuple) => {
const coordsWithoutAltitude = [coordinates[0], coordinates[1]]

return coordsWithoutAltitude
.sort((a, b) => (a > b ? 1 : -1))
.reverse() as LatLngTuple
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is a bit strange the type is casted to the same incomming type while the function converts it to a different structure. An idea to create a new LatLng type which is used as return type for this function? This should also be used where you change the type to [number,number] now. Like this:

Screenshot 2024-08-20 at 14 19 32

@alimpens alimpens requested a review from vdegraaf August 20, 2024 13:25
@alimpens alimpens merged commit 72cb7b3 into main Aug 21, 2024
6 checks passed
@alimpens alimpens deleted the update-leaflet-types branch August 21, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants