Skip to content

Commit

Permalink
Fixed circle type in drawer support OL
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed May 16, 2017
1 parent a0bba36 commit a6f9a25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/client/components/map/openlayers/DrawSupport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const DrawSupport = React.createClass({
let center = ol.extent.getCenter(drawnGeometry.getExtent());
let coordinates = drawnGeometry.getCoordinates();

let isCircleType = coordinates.length > 0 && coordinates[0] && coordinates[0].length === 101 ? true : false;
let isCircleType = type === 'Polygon' && coordinates.length > 0 && coordinates[0] && coordinates[0].length === 101 ? true : false;

if (startingPoint) {
coordinates = concat(startingPoint, coordinates);
Expand All @@ -276,7 +276,7 @@ const DrawSupport = React.createClass({
type,
extent: extent,
center: center,
coordinates: coordinates[0].concat([coordinates[0][0]]),
coordinates: type === "Polygon" ? coordinates[0].concat([coordinates[0][0]]) : coordinates,
radius: radius,
projection: this.props.map.getView().getProjection().getCode()
};
Expand Down

0 comments on commit a6f9a25

Please sign in to comment.