Maps API for JavaScript Developer's Guide

H.mapevents.Behavior

Class Summary

Extends: H.util.Disposable

Behavior class uses map events and adds behavior functionality to the map. This allows map panning and zooming via using mouse wheel

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

static DRAGGING : {number}

Map responds to user dragging via mouse or touch

static WHEELZOOM : {number}

Map zooms in or out in respond to mouse wheel events

static DBLTAPZOOM : {number}

Map zooms in or out in response to double click or double tap. For double tap if more that one touches are on the screen map will zoom out.

Method Summary

Table 2. Methods
Methods

dispose ()

This method destroys all map interaction handling. Should be used when the behavior functionality is disposed. Behavior object will also be disposed (this function will be called) when attached H.mapevents.MapEvents object is dispose.

disable (opt_behavior)

This method disables the behavior functionality for the map

enable (opt_behavior)

This method re-enables the behavior functionality for the map.

isEnabled (behavior) : {boolean}

This method checks if certain functionality is enabled

Class Description

Behavior class uses map events and adds behavior functionality to the map. This allows map panning and zooming via using mouse wheel

Example

// Add map events functionality to the map
var mapEvents = new H.mapevents.MapEvents(mapInstance);

// Add behavior to the map. This will enable panning, zooming, dragging on the map.
var behavior = new H.mapevents.Behavior(mapEvents);

Constructor Details

H.mapevents.Behavior(mapEvents, options)

Parameters:
 
mapEvents:
{H.mapevents.MapEvents}
 
previously initialized map events instance
options:
{H.mapevents.Behavior.Options}
 
additional options (i.e kinetics)

Property Details

static DRAGGING: {number}

Map responds to user dragging via mouse or touch

static WHEELZOOM: {number}

Map zooms in or out in respond to mouse wheel events

static DBLTAPZOOM: {number}

Map zooms in or out in response to double click or double tap. For double tap if more that one touches are on the screen map will zoom out.

Method Details

dispose ()

This method destroys all map interaction handling. Should be used when the behavior functionality is disposed. Behavior object will also be disposed (this function will be called) when attached H.mapevents.MapEvents object is dispose.

disable (opt_behavior)

This method disables the behavior functionality for the map

Parameters:
 
opt_behavior:
{number=} [optional]
 
The bitmask of behaviors to disable. If no arguments are passed, all behaviors will be disabled.

enable (opt_behavior)

This method re-enables the behavior functionality for the map.

Parameters:
 
opt_behavior:
{number=} [optional]
 
The bitmask of behaviors to enable. If no arguments are passed, all behaviors will be enabled.

isEnabled (behavior) : {boolean}

This method checks if certain functionality is enabled

Parameters:
 
behavior:
{number}
 
value like H.mapevents.Behavior.DRAGGING which the check is being performed
Returns:
 
{boolean}

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.