Extendable snapping events


As a mapwindow 5 plugin developer I would like to add CAD snapping tools but currently the snapping behaviour is hard-coded in mapwingis.

Proposed technical solution involves adding two events to the map:
SnapPointRequested and SnapPointFound
the first one is fired before the default snapping algorithm implemented is run, the second one is fired after a snap point was found (either by SnapPointRequested or by the default algorithm).

The SnapPointRequested event would include 2 boolean flags that can be set by the event consumer:

  • isFinal: this flag indicates the snap point returned in the event args is to be considered final and the default algorithm will not be run - it is up to all event consumers to check if the flag is already set by a previous consumer and respect it.

  • isFound: this flag can be used to signal mapwindow a snap point has been provided, but it's not final. This means that the point will be compared with other snap points returned by the default algorithm. Setting this flag to false will result in the snap point coordinates of the event handler args to be ignored & execution of the default algorithm.



Mathijs Dumon


Mathijs Dumon



Epic Link


Affects versions

Fix versions