Snap Guides Helper Mode
The Snap Guides Helper Mode adds visual guidelines that assist in snapping features to specific angles or points during map editing. This mode is useful when precise alignment is necessary while creating or modifying shapes.
You can enable Snap Guides Helper Mode with the following methods:
map.gm.enableMode('helper', 'snap_guides');
map.gm.disableMode('helper', 'snap_guides');
map.gm.toggleMode('helper', 'snap_guides');
map.gm.isModeEnabled('helper', 'snap_guides');
Events for Snap Guides Helper Mode
The following events are available on a map instance:
Event | Params | Description | Output |
---|---|---|---|
gm:globalsnappingmodetoggled | event | Fired when Snap Guides Helper Mode is toggled. | enabled , map |
Example Usage
You can listen for specific Snap Guides Helper Mode events on the map instance like this:
map.on('gm:globalsnappingmodetoggled', (event) => {
console.log(event);
});
Behavior
Snap guides work with the following shape types:
- Lines
- Polygons
- Rectangles
- Circles
- Multi-polygons
The Snap Guides helper:
- Calculates and displays guidelines at specific angles or along existing features.
- Helps users to snap to key points like intersections or perpendicular lines.
- Snaps features to the closest guide point, with priority given to perpendicular or aligned snapping guides.
- Custom snapping tolerance can be configured for guides.