Maps API for JavaScript Developer's Guide

H.mapevents.ContextMenuEvent

Class Summary

Extends: H.util.Event

This class represents an event to be fired when a user right-clicks or longpresses on a map object.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

items : {Array<H.util.ContextItem>}

This property contains ContextItems that be used to create context menu entries and set by listeners of the "contextmenu" event.

viewportX : {number}

This property holds the x-position in the map viewport.

viewportY : {number}

This property holds the y-position in the map viewport.

target : {(H.map.Object | H.Map)}

This property holds the target for the event.

originalEvent : {Event}

This property holds the original event.

currentTarget : {(H.map.Object | H.Map)}

This property holds an object with an attached listener.

type : {string}

This property holds the name of the dispatched event.

defaultPrevented : {boolean}

This property holds a value indicating if preventDefault() was called on the current event.

Method Summary

Table 2. Methods
Methods

preventDefault ()

This method sets the value of the property defaultPrevented. The property can be used to prevent default behavior associated with the given event.

stopPropagation ()

This method stops the propagation of the current event.

Class Description

This class represents an event to be fired when a user right-clicks or longpresses on a map object.

Constructor Details

H.mapevents.ContextMenuEvent(viewportX, viewportY, target, originalEvent)

Parameters:
 
viewportX:
{number}
 
The x coordinate of the event location in the viewport
viewportY:
{number}
 
The y coordinate of the event location in the viewport
target:
{(H.Map | H.map.Object)}
 
The target element of the event
originalEvent:
{Event}
 
An object representing the original event

Property Details

items: {Array<H.util.ContextItem>}

This property contains ContextItems that be used to create context menu entries and set by listeners of the "contextmenu" event.

viewportX: {number}

This property holds the x-position in the map viewport.

viewportY: {number}

This property holds the y-position in the map viewport.

target: {(H.map.Object | H.Map)}

This property holds the target for the event.

originalEvent: {Event}

This property holds the original event.

currentTarget: {(H.map.Object | H.Map)}

This property holds an object with an attached listener.

type: {string}

This property holds the name of the dispatched event.

defaultPrevented: {boolean}

This property holds a value indicating if preventDefault() was called on the current event.

Method Details

preventDefault ()

This method sets the value of the property defaultPrevented. The property can be used to prevent default behavior associated with the given event.

stopPropagation ()

This method stops the propagation of the current event.