new TouchCompass(options, onDrag)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | |
onDrag |
function | undefined | Function handling "drag" events. It provides a dpixel and a traction (in projection) vector form the center of the compas |
options.size |
Number | size of the compass in px, default 80 |
options.alpha |
Number | opacity of the compass, default 0.5 |
Extends
- ol.interaction.Pointer
Methods
-
setActive(active)
-
Activate or deactivate the interaction.
Parameters:
Name Type Description active
boolean Active.
-
setMap(map)
-
Remove the interaction from its current map, if any, and attach it to a new map, if any. Pass
null
to just remove the interaction from the current map.Parameters:
Name Type Description map
_ol_Map_ Map.