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

Fixed #1472 handled multiple markers/points when bearing is activated #1536

Merged
merged 4 commits into from
Mar 13, 2017

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Mar 10, 2017

Fixed #1472
The listener on the click on the map apply some sort of debouncing. This is causing sometimes to skip the case when 2 markers are added and passes from 1 to 3 (for example).

When this happens it stops drawing any other marker and it calculate the bearing on the first 2 inserted.

@MV88 MV88 changed the title handled multiple markers/points when bearing is activated Fixed #1472 handled multiple markers/points when bearing is activated Mar 10, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-19.4%) to 57.75% when pulling eb115ee on MV88:iss_1472_bearing into c735782 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 76.993% when pulling bdc1c8c on MV88:iss_1472_bearing into c735782 on geosolutions-it:master.

} else {
this.updateMeasurementResults();
let bearingMarkers = this.drawControl._markers || [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify :

if (bearingMarkers.length >= 2 && this.props.measurement.geomType === 'Bearing') {
     this.drawControl._markers = slice(this.drawControl._markers, 0, 2);
     this.drawControl._poly._latlngs = slice(this.drawControl._poly._latlngs, 0, 2);
     this.drawControl._poly._originalPoints = slice(this.drawControl._poly._originalPoints, 0, 2);
     this.updateMeasurementResults();
     this.drawControl._finishShape();
     this.drawControl.disable();
} else {
     updateMeasurementResults()
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 76.969% when pulling 0801fb8 on MV88:iss_1472_bearing into c735782 on geosolutions-it:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 76.976% when pulling d8ad99e on MV88:iss_1472_bearing into c735782 on geosolutions-it:master.

@offtherailz offtherailz merged commit d89c512 into geosolutions-it:master Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants