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

Fix triangle in object editing #5026

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/editing/createregularpolygonfromclickComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ exports.Controller_.prototype.$onInit = function() {
* @private
*/
exports.Controller_.prototype.handleDrawEnd_ = function(evt) {
const feature = new olFeature(evt.feature.getGeometry());
const feature = new olFeature(evt.detail.feature.getGeometry());
this.features.push(feature);
};

Expand Down
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