Maps API for JavaScript Developer's Guide

H.mapevents.ContextMenuEvent

Class Summary

Extends: H.util.Event

ContextMenuEvent should 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>}

Contains ContextItems, that will be used to create context menu entries. Should be filled by listeners of the "contextmenu" event

viewportX : {number}

Map viewport x position

viewportY : {number}

Map viewport y position

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

Target for the event

originalEvent : {Event}

Original event

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

Object which has listener attached

type : {string}

Name of the dispatched event

defaultPrevented : {boolean}

Indicates if preventDefault was called on the current event

Method Summary

Table 2. Methods
Methods

preventDefault ()

Sets defaultPrevented to true. Which can be used to prevent some default behavior.

stopPropagation ()

Stops propagation for current event.

Class Description

ContextMenuEvent should 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 on the viewport
viewportY:
{number}
 
The y coordinate on the viewport
target:
{(H.Map | H.map.Object)}
 
The event's target element
originalEvent:
{Event}
 
target of the event

Property Details

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

Contains ContextItems, that will be used to create context menu entries. Should be filled by listeners of the "contextmenu" event

viewportX: {number}

Map viewport x position

viewportY: {number}

Map viewport y position

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

Target for the event

originalEvent: {Event}

Original event

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

Object which has listener attached

type: {string}

Name of the dispatched event

defaultPrevented: {boolean}

Indicates if preventDefault was called on the current event

Method Details

preventDefault ()

Sets defaultPrevented to true. Which can be used to prevent some default behavior.

stopPropagation ()

Stops propagation for current event.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.