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

Doesn't return rotation help-layer over getGeomanLayers() #1287

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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