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

Draw and modify interaction need to accept geometry layout #2700

Closed
tschaub opened this issue Sep 9, 2014 · 7 comments · Fixed by #13546
Closed

Draw and modify interaction need to accept geometry layout #2700

tschaub opened this issue Sep 9, 2014 · 7 comments · Fixed by #13546
Labels

Comments

@tschaub
Copy link
Member

tschaub commented Sep 9, 2014

The draw and modify interactions create new point geometries. The interactions need to be configured with a geometry layout in order to be used with anything but XY layouts.


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@tschaub tschaub added the bug label Sep 9, 2014
@geographika
Copy link

Just ran into this issue. No easy workaround either as I'm using a WFS layer with GML as the source, which only allows for an XYZ layout.

Assert errors are thrown in ol.geom.flat.deflate.coordinates(flatCoordinates, offset, coords, stride); as the original features have 3 coordinates (stride 3), and any new vertices only have an X,Y.

The goog.asserts.assert(coordinate.length == stride) therefore fails.

@fastrde
Copy link

fastrde commented Nov 24, 2014

same problem here with GPX Layers (Layout "XYZM").
my workaround is:

ol.geom.flat.deflate.coordinates =
    function(flatCoordinates, offset, coordinates, stride) {
  var i, ii;
  for (i = 0, ii = coordinates.length; i < ii; ++i) {
    var coordinate = coordinates[i];

insert this:

    if (coordinate.length < stride){
      for (var x = coordinate.length; x < stride; x++){
        coordinate.push(0);
      }
    }
    if (coordinate.length > stride){
      for (var x = coordinate.length - stride; x <= coordinate.length; x++){
        coordinate.pop();
      }
    }

before:

    goog.asserts.assert(coordinate.length == stride);
    var j;
    for (j = 0; j < stride; ++j) {
      flatCoordinates[offset++] = coordinate[j];
    }
  }
  return offset;
};

@ahocevar
Copy link
Member

See #3036 for a fix in ol.interaction.Modify.

@stale
Copy link

stale bot commented May 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 22, 2019
@stale stale bot closed this as completed May 29, 2019
@drnextgis
Copy link
Contributor

Please correct me if I'm wrong but as far as I can see there is still no way to specify geometry layout for ol.interaction.Draw?

@ahocevar
Copy link
Member

I think you're right, @drnextgis

@drnextgis
Copy link
Contributor

@ahocevar I've made a PR to fix that. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants