From bdc1c8c5ca45859eeba0c2b8b43113be490b9a7e Mon Sep 17 00:00:00 2001 From: Matteo Velludini Date: Fri, 10 Mar 2017 16:44:55 +0100 Subject: [PATCH] fixed test --- web/client/components/map/leaflet/MeasurementSupport.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client/components/map/leaflet/MeasurementSupport.jsx b/web/client/components/map/leaflet/MeasurementSupport.jsx index f96bdb7f4a..d196d78c2b 100644 --- a/web/client/components/map/leaflet/MeasurementSupport.jsx +++ b/web/client/components/map/leaflet/MeasurementSupport.jsx @@ -54,7 +54,7 @@ const MeasurementSupport = React.createClass({ this.lastLayer = evt.layer; if (this.props.measurement.geomType === 'Point') { - let pos = this.drawControl._marker.getLatLng(); + let pos = this.drawControl._markers.getLatLng(); let point = {x: pos.lng, y: pos.lat, srs: 'EPSG:4326'}; let newMeasureState = assign({}, this.props.measurement, {point: point}); this.props.changeMeasurementState(newMeasureState); @@ -119,7 +119,7 @@ const MeasurementSupport = React.createClass({ this.drawControl.enable(); this.drawing = true; } else { - let bearingMarkers = this.drawControl._markers; + let bearingMarkers = this.drawControl._markers || []; if (bearingMarkers.length <= 2 ) { this.updateMeasurementResults();