Maps API for JavaScript Developer's Guide

H.ui.UI

Class Summary

Implements: H.util.ICapturable

This class encapsulates map UI functionality.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getElement () : {Element}

This method retrieves the root element of the user interface.

getMap () : {H.Map}

This method retrieves the map instance to which the UI was added.

getUnitSystem () : {H.ui.UnitSystem}

This method retrieves the current distance measurement system for the given UI instance.

setUnitSystem (unitSystem)

This method sets the distance measurement system for the given UI object.

toggleUnitSystem ()

This method toggles distance measurement system between H.ui.UnitSystem.METRIC and H.ui.UnitSystem.IMPERIAL.

addBubble (bubble)

This method adds an info bubble to the UI.

removeBubble (bubble)

This method removes a previously added info bubble from the UI.

getBubbles () : {Array<H.ui.InfoBubble>}

This method retrieves a list of info bubble objects which are currently attached to the UI.

addControl (name, control)

This method appends a control to the UI.

removeControl (name) : {H.ui.Control}

This method removes a previously registered control from the UI object.

getControl (name) : {H.ui.Control}

This method retrieves a UI control which was previously registered with the provided name.

static createDefault (map, mapTypes, opt_locale) : {H.ui.UI}

This function creates the default UI including the zoom control, map settings control and scalebar and panorama discovery control. The default controls are assigned the following values:

Class Description

This class encapsulates map UI functionality.

Constructor Details

H.ui.UI(map, opt_options)

Parameters:
 
map:
{H.Map}
 
An object repreenting the map
opt_options:
{H.ui.UI.Options=} [optional]
 
An optional object containing the initialization parameters.

Method Details

getElement () : {Element}

This method retrieves the root element of the user interface.

Returns:
 
{Element}
The root element of the user interface

getMap () : {H.Map}

This method retrieves the map instance to which the UI was added.

Returns:
 
{H.Map}
An object representing the map instance

getUnitSystem () : {H.ui.UnitSystem}

This method retrieves the current distance measurement system for the given UI instance.

Returns:
 
{H.ui.UnitSystem}
The identifier of the distance measurement system currently in use

setUnitSystem (unitSystem)

This method sets the distance measurement system for the given UI object.

Parameters:
 
unitSystem:
{H.ui.UnitSystem}
 
The distance measurement system to use

toggleUnitSystem ()

This method toggles distance measurement system between H.ui.UnitSystem.METRIC and H.ui.UnitSystem.IMPERIAL.

addBubble (bubble)

This method adds an info bubble to the UI.

Parameters:
 
bubble:
{H.ui.InfoBubble}
 
The info bubble to be added

removeBubble (bubble)

This method removes a previously added info bubble from the UI.

Parameters:
 
bubble:
{H.ui.InfoBubble}
 
The info bubble to be removed

getBubbles () : {Array<H.ui.InfoBubble>}

This method retrieves a list of info bubble objects which are currently attached to the UI.

Returns:
 
{Array<H.ui.InfoBubble>}
A list object containing the retrieved info bubbles

addControl (name, control)

This method appends a control to the UI.

Parameters:
 
name:
{string}
 
The name under which to register the control
control:
{H.ui.Control}
 
The control to add to the UI

removeControl (name) : {H.ui.Control}

This method removes a previously registered control from the UI object.

Parameters:
 
name:
{string}
 
The name under which the control was previously registered
Returns:
 
{H.ui.Control}
An object representing the removed control

getControl (name) : {H.ui.Control}

This method retrieves a UI control which was previously registered with the provided name.

Parameters:
 
name:
{string}
 
The name under which the control was registered
Returns:
 
{H.ui.Control}
The retrieved control object or undefined if the control does not exist.

static createDefault (map, mapTypes, opt_locale) : {H.ui.UI}

This function creates the default UI including the zoom control, map settings control and scalebar and panorama discovery control. The default controls are assigned the following values:

  • Zoom control:
    • id: 'zoom'
    • alignment: 'right-middle'
  • Map settings control:
    • id: 'mapsettings'
    • alignment: 'bottom-right'
  • Scalebar:
    • id: 'scalebar'
    • alignment: 'bottom-right'
  • Pano:
    • id: 'panorama'
    • alignment: 'top-right'
Parameters:
 
map:
{H.Map}
 
The map instance to which to append the UI
mapTypes:
{Object<H.service.MapType>}
 
The map types to use
opt_locale:
{(H.ui.i18n.Localization | string=)}
 
The language to use (or a full localization object).
Returns:
 
{H.ui.UI}
The UI instance configured with the default controls

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.