Modify interaction allows vertices to be added where they shouldn't be #1808

Merged
merged 1 commit into from Mar 12, 2014

Conversation

Projects
None yet
2 participants
Owner

ahocevar commented Mar 12, 2014

With the modify features example, it is possible to get into a weird editing state where vertices are added where they shouldn't be.

modify

The easiest way I've found to reproduce this is below:

  • select the top multi-polygon for editing
  • add a vertex to the left edge of the right box
  • try to add a vertex to the right edge of the left box

Instead of a vertex getting added to the right edge of the left box, it gets added to the bottom edge. After this, vertices can be added at unexpected locations (e.g. outside the geometry altogether).

This may or not have the same cause as #1807.

Owner

ahocevar commented Mar 5, 2014

I'm looking into this now as well. It is probably not caused by the same issue as #1807, but by the different way geometry collections and multi geometries are handled in the new geom package.

Owner

ahocevar commented Mar 12, 2014

Pull request with fix attached. Thanks for any review.

Owner

tschaub commented Mar 12, 2014

It isn't obvious to me why depth is an array. Can you point out what I'm missing?

Either way, this looks like a sensible fix.

Owner

tschaub commented Mar 12, 2014

@ahocevar see f7e3ba9 (added on top of your 62034e8).

Owner

ahocevar commented Mar 12, 2014

@tschaub I was tempted to do the same thing you did in 62034e8, but decided against it because the next step for the Modify interaction is to support editing of interior polygon rings (right now you can only edit the exterior ring), and that would be best solved with a 2nd entry in the depth array (1st is the ring index of the polygon, 2nd is the polygon index of the multipolygon).

Owner

tschaub commented Mar 12, 2014

@ahocevar thanks for the explanation - makes sense.

@ahocevar ahocevar added a commit that referenced this pull request Mar 12, 2014

@ahocevar ahocevar Merge pull request #1808 from ahocevar/modify-multi
Modify interaction allows vertices to be added where they shouldn't be
e017555

@ahocevar ahocevar merged commit e017555 into openlayers:master Mar 12, 2014

1 check passed

default The Travis CI build passed
Details

ahocevar deleted the ahocevar:modify-multi branch Mar 12, 2014

Owner

ahocevar commented Mar 12, 2014

@tschaub See #1854 for interior ring modification support.

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