new TouchCursor(options)
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
olx.interaction.InteractionOptions | Options Properties
|
Extends
Methods
-
addButton(button)
-
Add a button element
Parameters:
Name Type Description button* options.classNamestring button class name
options.htmlDOMElement | string button content
options.clickfunction onclick function
options.on* an object with
options.beforeboolean -
addOverlay(ov)
-
Add an overlay to the interacton
Parameters:
Name Type Description ovol.Overlay - Inherited From:
- Overrides:
-
getButtonElement(button)
-
Get cursor button element
Parameters:
Name Type Description buttonstring | number the button className or the button index
Returns:
- Type
- Element
-
getOverlay()
-
Get cursor overlay
Returns:
- Type
- ol.Overlay
-
getOverlayElement()
-
Get cursor overlay element
Returns:
- Type
- Element
-
getPixel()
-
Get pixel position
Returns:
- Type
- ol.pixel
-
getPosition()
-
Get the position of the target
Returns:
- Type
- ol.coordinate
-
offsetPosition(coord)
-
Offset the target position
Parameters:
Name Type Description coordol.coordinate -
removeButton(button)
-
Remove a button element
Parameters:
Name Type Description buttonstring | number | undefined the button className or the button index, if undefined remove all buttons, default remove all
Returns:
- Type
- Element
-
removeOverlay(ov)
-
Remove an overlay from the interacton
Parameters:
Name Type Description ovol.Overlay - Inherited From:
- Overrides:
-
setActive(active, position)
-
Activate or deactivate the interaction.
Parameters:
Name Type Description activeboolean Active.
positionol.coordinate | null position of the cursor (when activating), default viewport center.
-
setAnchor(pos)
-
Set anchor position
Parameters:
Name Type Description posstring "left", "center" or "right"
-
setMap(map)
-
Remove the interaction from its current map, if any, and attach it to a new map, if any. Pass
nullto just remove the interaction from the current map.Parameters:
Name Type Description map_ol_Map_ Map.
-
setPosition(coord)
-
Set the position of the target
Parameters:
Name Type Description coordol.coordinate