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

Add Circle Modification #6457

Merged
merged 4 commits into from Feb 6, 2017

Conversation

Projects
None yet
2 participants
@tst-ppenev
Contributor

tst-ppenev commented Feb 6, 2017

  • Add an ol.coordinate.distance() helper method.
  • Add {ModifySegmentDataType#featureSegments} field. It references all modifiable segments that belong to a feature. We need access to them, so we can update them when a circle's center is moved.
    Circles are broken into two modifiable line segments: center and
    circumference.
  • Add method {@link ol.interaction.Modify#writeCircleGeometry_} for adding a circle to the R*-bush of modifiable segments.
  • Update methods {handleDownEvent_}, {handleDragEvent_}, {handleUpEvent_} and
    {handlePointerAtPixel_} to support circle segments.
  • Add helper static methods
    {@link ol.interaction.Modify.pointDistanceToSegmentDataSquared_} and
    {@link ol.interaction.Modify.closestOnSegmentData_} with support for
    circle line segments.
  • Add constants {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX} and
    {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX}.
  • Add circles to example page.
  • Add circle unit tests. (Thanks, @ahocevar!)

This pull request replaces #5704. The old one can be declined.

tst-ppenev and others added some commits Jun 21, 2016

Add an `ol.coordinate.distance()` helper method.
The method is a companion to {@link ol.coordinate.squaredDistance}.
The new method returns the Cartesian distance, instead of its square.

Conflicts:
	src/ol/coordinate.js
Add circle support to {ol.interaction.Modify}
Circles are broken into two modifiable line segments: center and
circumference.

Method {@link ol.interaction.Modify#writeCircleGeometry_} has been
added for adding a circle to the R*-bush of modifiable segments.

Methods {handleDownEvent_}, {handleDragEvent_}, {handleUpEvent_} and
{handlePointerAtPixel_} have been updated to support circle segments.

Helper static methods
{@link ol.interaction.Modify.pointDistanceToSegmentDataSquared_} and
{@link ol.interaction.Modify.closestOnSegmentData_} with support for
circle line segments have been added.

Constants {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX}
and
{@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX}
have been added.

Conflicts:
	src/ol/interaction/modify.js

@tst-ppenev tst-ppenev referenced this pull request Feb 6, 2017

Closed

Add Circle Modification #5704

@ahocevar

Looks good now. Thanks for the continued effort on this!

@ahocevar ahocevar merged commit bff6a14 into openlayers:master Feb 6, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.05%) to 87.529%
Details

@fredj fredj referenced this pull request May 9, 2017

Closed

Support editing circles #5510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment