Skip to content

Commit

Permalink
Fix triangle in object editing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jul 18, 2019
1 parent e90b4e0 commit 3ab910f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/interaction/DrawRegularPolygonFromClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as olEvents from 'ol/events.js';
import olFeature from 'ol/Feature.js';
import * as olFunctions from 'ol/functions.js';
import olGeomCircle from 'ol/geom/Circle.js';
import olGeomPolygon from 'ol/geom/Polygon.js';
import {fromCircle, makeRegular} from 'ol/geom/Polygon.js';
import olInteractionInteraction from 'ol/interaction/Interaction.js';

/**
Expand Down Expand Up @@ -130,11 +130,12 @@ exports.prototype.disable_ = function() {
*/
exports.prototype.handleMapClick_ = function(evt) {
const center = evt.coordinate;
const geometry = olGeomPolygon.fromCircle(
const geometry = fromCircle(
new olGeomCircle(center), this.sides_
);

olGeomPolygon.makeRegular(geometry, center, this.radius_, this.angle_);
makeRegular(geometry, center, this.radius_, this.angle_);


/** @type {ngeox.DrawEvent} */
const event = new ngeoCustomEvent('drawend', {feature: new olFeature(geometry)});
Expand Down

0 comments on commit 3ab910f

Please sign in to comment.