Powered by Zoomin Software. For more details please contactZoomin

HERE Maps API for JavaScript - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Maps API for JavaScript - API Reference: Class: Behavior

Table of Contents

Class: Behavior

H.mapevents.Behavior

new H.mapevents.Behavior (mapEvents, options)

This class encapsulates map behavior functionality. It uses map events and adds functionality such as panning and zooming to the map.

By default the 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.

Name Type Description
mapEvents H.mapevents.MapEvents

An object representing a previously initialized map events instance

options H.mapevents.Behavior.Options optional

An object defining additional options (kinetics)

Throws:

if behavior is already instantiated with the specified mapEvents

Type
H.lang.InvalidArgumentError
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);

Extends

Members

H.mapevents.Behavior.Feature static

The feature types that can be enabled or disabled. See also H.mapevents.Behavior#enable, H.mapevents.Behavior#disable and the enable property in the H.mapevents.Behavior.Options.

Properties:

Methods

addOnDisposeCallback (callback, opt_scope) inherited

This method adds a callback which to be triggered when an object is disposed.

Name Type Description
callback function

A callback function to add

opt_scope Object optional

An object representing the scope

disable (opt_features)

To disable the specified behavior feature(s) for the map.

Name Type Description
opt_features H.math.BitMask.<!H.mapevents.Behavior.Feature> optional

The feature(s) to disable. If omitted all behavior features are disabled. To disable multiple features combine them with bitwise OR operator | (e.g. H.mapevents.Behavior.Feature.PANNING | H.mapevents.Behavior.Feature.HEADING).

dispose () inherited overrides

To discontinue 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.

disposeInternal () inherited

Performs appropriate cleanup.

enable (opt_features)

This method enables the specified behavior feature(s) for the map.

Name Type Description
opt_features H.math.BitMask.<!H.mapevents.Behavior.Feature> optional

The feature(s) to enable. If omitted all behavior features are enabled. To enable multiple features combine them with bitwise OR operator | (e.g. H.mapevents.Behavior.Feature.PANNING | H.mapevents.Behavior.Feature.HEADING).

isEnabled (features)boolean

This method checks if certain behavior feature(s) are enabled.

Name Type Description
features H.math.BitMask.<!H.mapevents.Behavior.Feature>

The feature(s) to check. To check against multiple features combine them with bitwise OR operator | (e.g. H.mapevents.Behavior.Feature.PANNING | H.mapevents.Behavior.Feature.HEADING).

Throws:

if features value is invalid

Type
H.lang.InvalidArgumentError
Returns:
Type Description
boolean true if the specified features are enabled, otherwise false

Type Definitions

H.mapevents.Behavior.Options Object

This typedef defines configuration (initialization) properties for the Behavior class.

Properties:
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert