geoman-io / leaflet-geoman

🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Cut bug #630

Closed Armaggik closed 4 years ago

Armaggik commented 4 years ago

Geoman

Falke-Design commented 4 years ago

@codeofsumit This is happening because of to much multi-polygon holes. When I flatten the multi-polygon to single layers it works

codeofsumit commented 4 years ago

I'm not aware of a limit in MultiPolygons. Is that a bug in Turf?

Falke-Design commented 4 years ago

Test what should be passed:

  it('test cut bug', ()=>{
    cy.toolbarButton('rectangle').click();
    cy.get(mapSelector)
      .click(191,216)
      .click(608,323);

    cy.toolbarButton('cut').click();
    cy.get(mapSelector)
      .click(226,389)
      .click(230,105)
      .click(270,396)
      .click(226,389);

    cy.toolbarButton('cut').click();
    cy.get(mapSelector)
      .click(293,356)
      .click(293,122)
      .click(340,367)
      .click(293,356);

    cy.toolbarButton('cut').click();
    cy.get(mapSelector)
      .click(364,345)
      .click(363,138)
      .click(414,368)
      .click(364,345);

    cy.toolbarButton('edit').click();
    cy.hasVertexMarkers(16);
  })

@codeofsumit yes it is because of Turf.js (https://github.com/Turfjs/turf/issues/1922)

Falke-Design commented 4 years ago

Fixed in Release: 2.7.0