Skip to content

Commit

Permalink
doesn't return the rotation help-layer over getGeomanLayers() (#1287)…
Browse files Browse the repository at this point in the history
… (patch)
  • Loading branch information
Falke-Design authored Jan 15, 2023
1 parent 9a0341d commit 6d8b969
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cypress/integration/rotation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,17 @@ describe('Rotation', () => {
}).to.not.throw();
});
});

it('doesn\'t return the rotation help-layer over getGeomanLayers()', () => {
cy.window().then(({ map, L }) => {
const coords = [
[1, 2],
[3, 4],
];
const rect = L.rectangle(coords).addTo(map);
rect.pm.enableRotate();

expect(map.pm.getGeomanLayers().length).to.eq(1);
});
});
});
1 change: 1 addition & 0 deletions src/js/Mixins/Rotating.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const RotateMixin = {
});
// we connect the temp polygon (that will be enabled for rotation) with the current layer, so that we can rotate the current layer too
this._rotatePoly.pm._rotationLayer = this._layer;
this._rotatePoly._pmTempLayer = true;
this._rotatePoly.pm.enable();

// store the original latlngs
Expand Down

0 comments on commit 6d8b969

Please sign in to comment.