Skip to content

Commit

Permalink
feat(modify): the modify control can now add holes to a polygon by ho…
Browse files Browse the repository at this point in the history
…lding the CTRL key
  • Loading branch information
cbourget committed May 2, 2019
1 parent 41930f0 commit 601a295
Show file tree
Hide file tree
Showing 3 changed files with 332 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ export class GeometryFormFieldInputComponent implements OnInit, OnDestroy, Contr
private updateMeasureTooltip(olGeometry: OlGeometry) {
const measure = measureOlGeometry(olGeometry, this.map.projection);
const lengths = measure.lengths;
const lastLength = lengths[lengths.length - 1];
const lastIndex = olGeometry.getType() === 'Polygon' ? lengths.length - 2 : lengths.length - 1;
const lastLength = lengths[lastIndex];

const olMidpoints = updateOlGeometryMidpoints(olGeometry);
const lastIndex = olGeometry.getType() === 'Polygon' ? olMidpoints.length - 2 : olMidpoints.length - 1;
const olLastMidpoint = olMidpoints[lastIndex];

this.olTooltip.setPosition(olLastMidpoint.flatCoordinates);
Expand Down
Loading

0 comments on commit 601a295

Please sign in to comment.