From a6f9a257e1b5ebc818e3963ee08c6cc133b89306 Mon Sep 17 00:00:00 2001 From: allyoucanmap Date: Tue, 16 May 2017 14:52:57 +0200 Subject: [PATCH] Fixed circle type in drawer support OL --- web/client/components/map/openlayers/DrawSupport.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client/components/map/openlayers/DrawSupport.jsx b/web/client/components/map/openlayers/DrawSupport.jsx index 92a6c3b7fb..c6a03ff13d 100644 --- a/web/client/components/map/openlayers/DrawSupport.jsx +++ b/web/client/components/map/openlayers/DrawSupport.jsx @@ -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); @@ -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() };