Feature/editmode cartesian rectangle#654
Conversation
|
Worked #641 in lets get this branch up to date and see where we stand |
|
@charlieforward9 resolved minor merge conflicts and ran tests locally |
| return Math.abs(orientation(p1, p2, p)) / len; | ||
| } | ||
|
|
||
| export function generatePointsParallelToLinePointsCartesian( |
There was a problem hiding this comment.
Adding a little comment/illustration elaborating on this function behavior or making the name a little clear would be great.
My guess is these would eventually make it into math.gl and we would want to make it clear where else it may be reusable.
| coordinateSystem: EditModeCoordinateSystem | ||
| ): Feature<Polygon> | null | undefined { | ||
| const [p3, p4] = generatePointsParallelToLinePoints(coord1, coord2, coord3); | ||
| // const [p3, p4] = generatePointsParallelToLinePoints(coord1, coord2, coord3); |
There was a problem hiding this comment.
Comment is not necessary
| return event.picks.length && event.picks.find(p => p.featureType === 'points'); | ||
| } | ||
|
|
||
| // Dispatch function to call function based on coord system, defaults to geo mode |
There was a problem hiding this comment.
for implies a loop, can we think of a better name suffix?
onCoordinateFunc...branch
There was a problem hiding this comment.
Looking at the scope of this utility file, it feels like coordinate conditional math should be packaged into a coordinate-math.ts file, instead of exporting the geospatial coordinate math & forCoord from this file and an independent cartesian-coordinate.ts file.
| props: ModeProps<SimpleFeatureCollection> | ||
| ): {handled: boolean} { | ||
| const outer = getPolygonFeature(feature.geometry.coordinates, props); | ||
| const cartesian = props.coordinateSystem instanceof CartesianCoordinateSystem; |
First crack at adding a Cartesian implementation for draw-rectangle-using-three-points-mode.ts. Added a few functions to
cartesian-utils.ts, and added props.coordinateSyste pass through fromThreeClickPolygonMode. Should add tests for cartesian util functions.DONT MERGE