Maps API for JavaScript Developer's Guide

H.mapevents.Behavior

Class Summary

Extends: H.util.Disposable

This class encapsulates map behavior functionality. It uses map events and adds functionality such as panning and zooming (via the mouse wheel) to the map.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

static DRAGGING : {number}

This property indicates if the map responds to user dragging via mouse or touch.

static WHEELZOOM : {number}

This property indicates if the map zooms in or out in response to mouse wheel events.

static DBLTAPZOOM : {number}

This property indicates if the map zooms in or out in response to double click or double tap. For double tap, multiple touches on the screen cause the map to zoom out.

Method Summary

Table 2. Methods
Methods

dispose ()

This method destroys the handling of all map interaction. It should be used when the behavior functionality is disposed of. The Behavior object is disposed of (this function is called) when the attached H.mapevents.MapEvents object is disposed of.

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 behavior functionality is enabled.

Class Description

This class encapsulates map behavior functionality. It uses map events and adds functionality such as panning and zooming (via the mouse wheel) to the map.

By default behavior will use H.util.animation.ease.EASE_OUT_QUAD animation with 600ms duration during interactions with the map.

This can be modified by specifying options.

Example

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

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

Constructor Details

H.mapevents.Behavior(mapEvents, opt_options)

Parameters:
 
mapEvents:
{H.mapevents.MapEvents}
 
An object representing a previously initialized map events instance
opt_options:
{H.mapevents.Behavior.Options=} [optional]
 
An object defining additional options (kinetics)
Throws:
 
{H.lang.InvalidArgumentError}
 
if behavior is already instantiated with the specified mapEvents

Property Details

static DRAGGING: {number}

This property indicates if the map responds to user dragging via mouse or touch.

static WHEELZOOM: {number}

This property indicates if the map zooms in or out in response to mouse wheel events.

static DBLTAPZOOM: {number}

This property indicates if the map zooms in or out in response to double click or double tap. For double tap, multiple touches on the screen cause the map to zoom out.

Method Details

dispose ()

This method destroys the handling of all map interaction. It should be used when the behavior functionality is disposed of. The Behavior object is disposed of (this function is called) when the attached H.mapevents.MapEvents object is disposed of.

disable (opt_behavior)

This method disables the behavior functionality for the map.

Parameters:
 
opt_behavior:
{number=} [optional]
 
A bitmask indicating behaviors to disable. If no bits are set in the bitmask, 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 bits are set in the bitmask, all behaviors will be enabled.

isEnabled (behavior) : {boolean}

This method checks if certain behavior functionality is enabled.

Parameters:
 
behavior:
{number}
 
A value indicating the functionality to check, for example H.mapevents.Behavior.DRAGGING
Returns:
 
{boolean}
true if the specified behavior is enabled, otherwise false

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.