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 returns this ui's root element.

getMap () : {H.Map}

Returns the map instance to which this UI was added.

getUnitSystem () : {H.ui.UnitSystem}

This method returns this UI object's current unit system.

setUnitSystem (unitSystem)

This method sets this UI object's unit system for displaying distances.

toggleUnitSystem ()

Toggles this UI's unit 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 returns a list of info bubble objects which are currently attached to this UI.

addControl (name, control)

This method appends a control to the UI.

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

Removes a previously registered control from the UI object.

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

This method returns 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 will be assigned the following values:

Class Description

This class encapsulates map UI functionality.

Constructor Details

H.ui.UI(map, opt_options)

Parameters:
 
map:
{H.Map}
 
opt_options:
{H.ui.UI.Options=} [optional]
 

Method Details

getElement () : {Element}

This method returns this ui's root element.

Returns:
 
{Element}
the root element

getMap () : {H.Map}

Returns the map instance to which this UI was added.

Returns:
 
{H.Map}

getUnitSystem () : {H.ui.UnitSystem}

This method returns this UI object's current unit system.

Returns:
 
{H.ui.UnitSystem}
the current unit system

setUnitSystem (unitSystem)

This method sets this UI object's unit system for displaying distances.

Parameters:
 
unitSystem:
{H.ui.UnitSystem}
 
the unit system to use

toggleUnitSystem ()

Toggles this UI's unit 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 returns a list of info bubble objects which are currently attached to this UI.

Returns:
 
{Array<H.ui.InfoBubble>}
the list of info bubbles

addControl (name, control)

This method appends a control to the UI.

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

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

Removes a previously registered control from the UI object.

Parameters:
 
name:
{string}
 
the name under which this control was previously registered
Returns:
 
{H.ui.Control}
the removed control

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

This method returns 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 control 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 will be 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.