Optional opt_options: SnapOptionsOptions.
Handles snapping of vector features while modifying or drawing them. The features can come from a ol.source.Vector or ol.Collection Any interaction object that allows the user to interact with the features using the mouse can benefit from the snapping, as long as it is added before.
The snap interaction modifies map browser event coordinate and pixel
properties to force the snap to occur to any interaction that them.
Example:
var snap = new ol.interaction.Snap({
source: source
});
Listen for a certain type of event.
The event type or array of event types.
The listener function.
Optional opt_this: ObjectThe object to use as this in listener.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
stable
Listen once for a certain type of event.
The event type or array of event types.
The listener function.
Optional opt_this: ObjectThe object to use as this in listener.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
stable
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
Values.
Optional opt_silent: booleanUpdate without triggering an event.
stable
Removes an event listener using the key returned by on() or once().
Note that using the ol.Observable.unByKey static function is to
be preferred.
stable
Static handleHandles the map browser event and may call into other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are detected.
Map browser event.
false to stop event propagation.
Static unGenerated using TypeDoc
Classdesc
Handles snapping of vector features while modifying or drawing them. The features can come from a ol.source.Vector or ol.Collection Any interaction object that allows the user to interact with the features using the mouse can benefit from the snapping, as long as it is added before.
The snap interaction modifies map browser event
coordinateandpixelproperties to force the snap to occur to any interaction that them.Example:
Param: opt_options
Options.
Api