Class: Pointer

H.mapevents.Pointer

new H.mapevents.Pointer (viewportX, viewportY, id, type, opt_button, opt_buttons)

This class represents a pointer on the map surface. A pointer in a platform-specific definition can refer to the mouse, touch, pen or any pointing device which can trigger browser events.

Name Type Description
viewportX number

The pointer position on x-axis

viewportY number

The pointer position on y-axis

id number

unique The pointer identifier among currently available pointers

type string

The identifier of the pointer type, which can be mouse', 'touch', 'pen'

opt_button H.mapevents.Pointer.Button optional

The identifier of the pointing device button that was used (whose state has changed)

opt_buttons H.mapevents.Pointer.Buttons optional

The pointing device buttons that is being pressed.

Members

H.mapevents.Pointer.Button number static

This enumeration defines identifiers for MouseEvent.button values

Properties:
Name Description
NONE

No button

LEFT

Left mouse button or touch contact or pen contact

MIDDLE

Middle mouse button

RIGHT

Right mouse button or Pen barrel button

button H.mapevents.Pointer.Button non-null

This property indicates which pointing device button has changed.

buttons H.mapevents.Pointer.Buttons non-null

This property indicates which pointer device buttons are being pressed.

dragTarget H.map.Object | H.Map

This property holds the object which is currently dragged by the pointer.

id number

This property holds the unique identifier of the pointer.

target H.map.Object | H.Map

This property holds the map object directly under the pointer. Its value can be null if the pointer is outside the map viewport.

type string

This property holds the identifier of the pointer type, which can be 'mouse', 'touch' or 'pen'.

viewportX number

This property holds the x-coordinate of the pointer in the map viewport.

viewportY number

This property holds the y-coordinate of the pointer in the map viewport.

Type Definitions

H.mapevents.Pointer.Buttons number

To store MouseEvent.buttons values in a bitmask.

  • 0: Indicates that no button is pressed
  • 1: Indicates that the left mouse button is pressed or Touch contact or Pen contact
  • 2: Indicates that the right mouse button is pressed, or Pen contact with barrel button pressed
  • 4: Indicates that the middle mouse button is pressed
See: