-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
We are using turf only for this single piece of code and therefore are not tracking changes in turf releases. To guard against breaking api changes in future turf releases etc. we should add a test for this function.
fixmy.frontend/src/apps/Map/map-utils.js
Lines 176 to 190 in e9ed240
export function getCenterFromGeom(geometry, defaultCenter = null) { | |
if (geometry && geometry.coordinates) { | |
if (geometry.type === 'MultiLineString') { | |
geometry = turfLineString( | |
geometry.coordinates.reduce((res, coord) => res.concat(coord)), | |
[] | |
); | |
} | |
const length = turfLength(geometry); | |
return turfAlong(geometry, length * 0.5).geometry.coordinates; | |
} | |
return defaultCenter; | |
} |
This is a good issue for first contributors. Please leave a message here if you would like assistance.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed