Rotate Mode
You can handle Rotate Mode for all layers on a map like this:
map.gm.enableGlobalRotateMode();
map.gm.disableGlobalRotateMode();
map.gm.toggleGlobalRotateMode();
map.gm.globalRotateModeEnabled();
// Or like this:
map.gm.enableMode('edit', 'rotate');
map.gm.disableMode('edit', 'rotate');
map.gm.toggleMode('edit', 'rotate');
map.gm.isModeEnabled('edit', 'rotate');
The following methods are available on map.gm
:
Method | Returns | Description |
---|---|---|
enableGlobalRotateMode() | - | Enables global Rotate Mode. |
disableGlobalRotateMode() | - | Disables global Rotate Mode. |
toggleGlobalRotateMode() | - | Toggles global Rotate Mode. |
globalRotateModeEnabled() | Boolean | Returns true if global Rotate Mode is enabled. false when disabled. |
The following events are available on a map instance:
Event | Params | Description | Output |
---|---|---|---|
gm:rotatestart | event | Fired when a layer starts being rotated. | map , feature , shape |
gm:rotate | event | Fired when a layer is being rotated. | map , feature , shape |
gm:rotateend | event | Fired when a layer stops being rotated. | map , feature , shape |
The following events are available on a map instance:
Event | Params | Description | Output |
---|---|---|---|
gm:globalrotatemodetoggled | event | Fired when Rotate Mode is toggled. | enabled , map |
You can also listen to specific Rotate Mode events on the map instance like this:
map.on('gm:globalrotatemodetoggled', (event) => {
console.log(event);
});