HERE Android SDK Developer's Guide

Map

The class Map is a member of com.here.android.mpa.mapping .

Class Summary

public final class Map

extends java.lang.Object

A Map object represents a virtual model of the world.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in Map
Nested Classes

public static final enumeration Map.Animation

Represents values that describe animation types for on-screen map movements.

public static final enumeration Map.FleetFeature

Fleet features to be rendered on the map

public static abstract interface Map.InfoBubbleAdapter

Interface for implementing custom info bubbles for MapMarker objects.

public static final enumeration Map.LayerCategory

Definition for layer categories within a map.

public static abstract interface Map.OnSchemeChangedListener

Listener for Map scheme changed events.

public static abstract interface Map.OnTransformListener

Listener for Map transform events.

public static final enumeration Map.PedestrianFeature

Pedestrian features to be rendered on the map

public static class Map.PixelResult

Result class for conversion of a GeoCoordinate to screen pixel coordinates.

public static final enumeration Map.Projection

The projection scheme used to render the map.

public static final class Map.Scheme

Represents a collection of schemes that the Map class supports.

Constructor Summary

Table 2. Constructors in Map
Constructors

Map ()

Default Constructor

Field Summary

Table 3. Fields in Map
Fields

public static final int ABSTRACT_CITY_MODEL

public static final int AIRPORT_AREA

public static final int AMUSEMENT_PARK

public static final int ANIMAL_PARK

public static final int BACKGROUND

public static final int BEACH

public static final int BORDER_BUILTUP

public static final int BORDER_COUNTRY

public static final int BORDER_LINE_OF_CONTROL

public static final int BORDER_REGIONAL

public static final int BORDER_STATE

public static final int BUILDING

public static final int BUILTUP

public static final int CEMETERY

public static final int CITY_PARK

public static final int DESERT

public static final int EXIT_SIGN

public static final int FERRY

public static final int GLACIER

public static final int GOLF_COURSE

public static final int HARBOR_AREA

public static final int HOSPITAL_CAMPUS

public static final int ICON_MOUNTAIN

public static final int ICON_PUBLIC_TRANSIT_STATION

public static final int INDUSTRIAL_COMPLEX

public static final int LABEL_AIRPORT_AREA

public static final int LABEL_AMUSEMENT_PARK

public static final int LABEL_ANIMAL_PARK

public static final int LABEL_BEACH

public static final int LABEL_BUILDING

public static final int LABEL_CEMETERY

public static final int LABEL_CITY_CAPITAL

public static final int LABEL_CITY_OTHER

public static final int LABEL_CITY_PARK

public static final int LABEL_CITY_STATE_CAPITAL

public static final int LABEL_CONTINENT

public static final int LABEL_DESERT

public static final int LABEL_FERRY

public static final int LABEL_GLACIER

public static final int LABEL_GOLF_COURSE

public static final int LABEL_HARBOR_AREA

public static final int LABEL_HOSPITAL_CAMPUS

public static final int LABEL_INDUSTRIAL_COMPLEX

public static final int LABEL_ISLAND

public static final int LABEL_MAJOR_COUNTRY

public static final int LABEL_MILITARY_BASE

public static final int LABEL_MINOR_COUNTRY

public static final int LABEL_MOUNTAIN

public static final int LABEL_NATIONAL_PARK

public static final int LABEL_NATIVE_RESERVATION

public static final int LABEL_NEIGHBORHOOD_AREA

public static final int LABEL_OCEAN

public static final int LABEL_PEDESTRIAN_AREA

public static final int LABEL_PUBLIC_TRANSIT_LINE

public static final int LABEL_PUBLIC_TRANSIT_STATION

public static final int LABEL_RAILYARD

public static final int LABEL_SEA

public static final int LABEL_SHOPPING_COMPLEX

public static final int LABEL_SPORTS_COMPLEX

public static final int LABEL_STATE

public static final int LABEL_STATE_ABBREVIATION

public static final int LABEL_STREET_CATEGORY_0

public static final int LABEL_STREET_CATEGORY_1

public static final int LABEL_STREET_CATEGORY_2

public static final int LABEL_STREET_CATEGORY_3

public static final int LABEL_STREET_CATEGORY_4

public static final int LABEL_STREET_CATEGORY_PEDESTRIAN

public static final int LABEL_STREET_CATEGORY_WALKWAY

public static final int LABEL_UNIVERSITY_CAMPUS

public static final int LABEL_WATER_OTHER

public static final int LABEL_WOODLAND

public static final int LAND

public static final int LAND_PARCEL

public static final int MILITARY_BASE

public static final float MOVE_PRESERVE_ORIENTATION

A valid orientation value that lies outside the minimum and maximum supported tilt range, used to indicate that the current orientation should be preserved.

public static final float MOVE_PRESERVE_TILT

A valid tilt value that lies outside the range of getMinTilt(void) and getMaxTilt(void), used to indicate that the current tilt should be preserved.

public static final double MOVE_PRESERVE_ZOOM_LEVEL

A valid zoom level value that lies outside the range of getMinZoomLevel() and getMaxZoomLevel(), used to indicate that the current zoom level should be preserved.

public static final int NATIONAL_PARK

public static final int NATIVE_RESERVATION

public static final int NEIGHBORHOOD_AREA

public static final int OUTLINE_MILITARY_BASE

public static final int OUTLINE_NATIONAL_PARK

public static final int OUTLINE_NATIVE_RESERVATION

public static final int PEDESTRIAN_AREA

public static final int PEDESTRIAN_FEATURE

public static final int POINT_ADDRESS

public static final int POI_ICON

public static final int POI_LABEL

public static final int PUBLIC_TRANSIT_LINE

public static final int RAILROAD

public static final int RAILYARD

public static final int RELIEF

public static final int ROADSIGN_ICON

public static final int SHOPPING_COMPLEX

public static final int SPORTS_COMPLEX

public static final int STREET_CATEGORY_0

public static final int STREET_CATEGORY_1

public static final int STREET_CATEGORY_2

public static final int STREET_CATEGORY_3

public static final int STREET_CATEGORY_4

public static final int STREET_CATEGORY_PEDESTRIAN

public static final int STREET_CATEGORY_WALKWAY

public static final int UNIVERSITY_CAMPUS

public static final int WATER

public static final int WOODLAND

Method Summary

Table 4. Methods in Map
Methods

public void addClusterLayer (ClusterLayer layer)

Attaches cluster layer to the map.

public boolean addMapObject (MapObject object)

Adds a MapObject to this Map .

public boolean addMapObjects (java.util.List <MapObject> objects)

Adds a List of multiple MapObject objects to this Map .

public boolean addMapOverlay (MapOverlay overlay)

Adds a MapOverlay to this Map .

public boolean addRasterTileSource (MapRasterTileSource source)

Adds a user-defined MapRasterTileSource to this Map .

public void addSchemeChangedListener (OnSchemeChangedListener listener)

Adds a Map.OnSchemeChangedListener to listen for map scheme change events.

public void addTransformListener (OnTransformListener listener)

Adds a Map.OnTransformListener to this Map to listen for map transform events.

public boolean areCartoMarkersVisible ()

Returns a boolean indicating whether all MapCartoMarkers of all IconCategory are visible.

public boolean areCartoMarkersVisible (IconCategory category)

Get if MapCartoMarkers of a certain POI category is shown.

public boolean areExtrudedBuildingsVisible ()

Returns a boolean indicating whether the extruded buildings layer is shown on this map.

public boolean areLandmarksVisible ()

Returns a boolean indicating whether 3D landmarks are currently visible.

public boolean areSafetySpotsVisible ()

Gets the current visibility of safety spots.

public static int convert (LayerCategory cat)

public CustomizableScheme createCustomizableScheme (String newSchemeName, String baseSchemeName)

Creates a customizable scheme based on an existing Map.Scheme.

public static void enableMaximumFpsLimit (boolean isLimited)

Function to enable/disable the FPS draw limit.

public void executeSynchronized (Runnable task)

Execute a batched set of commands to the Map .

public GeoBoundingBox getBoundingBox ()

Returns the current visible map area as a GeoBoundingBox.

public GeoCoordinate getCenter ()

Returns the GeoCoordinate location at the current center of this Map .

public String getCopyright ()

Returns the copyright notice text for this Map .

public CustomizableScheme getCustomizableScheme (String schemeName)

Retrieves a customizable scheme by using its name.

public java.util.EnumSet <FleetFeature> getFleetFeaturesVisible ()

Get the set of fleet features visible.

public int getHeight ()

Returns the current height of this Map , in number of pixels.

public MapBuildingLayer getMapBuildingLayer ()

Returns the MapBuildingLayer for this Map .

public String getMapDisplayLanguage ()

Get the language which the Map is set to render

public String getMapScheme ()

Returns the current scheme for the Map .

public List getMapSchemes ()

Returns a list containing all supported schemes for the Map .

public String getMapSecondaryDisplayLanguage ()

Get the secondary language which the Map is set to render

public MapState getMapState ()

Returns the current tilt, perspective, and zoom of the map as a MapState object.

public MapTrafficLayer getMapTrafficLayer ()

Get the MapTrafficLayer

public MapTransitLayer getMapTransitLayer ()

Returns the MapTransitLayer associated with this Map .

public float getMaxTilt ()

Returns the maximum degree allowed to be set as tilt angle for the Map .

public double getMaxZoomLevel ()

Returns the highest valid zoom level for Map , representing the closest view near the street-level

public static int getMaximumFps ()

Function to set the maximum drawing frames-per-second.

public float getMinTilt ()

Returns the minimum degree allowed to be set as tilt angle for the Map .

public double getMinZoomLevel ()

Returns the lowest valid zoom level for Map , representing the most distant view away from street-level.

public float getOrientation ()

Returns the current orientation for this Map , in degrees relative to true-north, which has an orientation of 0 degrees.

public java.util.EnumSet <PedestrianFeature> getPedestrianFeaturesVisible ()

Get the set of pedestrian features visible.

public PositionIndicator getPositionIndicator ()

Deprecated: As of SDK 3.3.

Returns the PositionIndicator instance that renders the current position with a marker.

public Projection getProjectionMode ()

Gets the current map projection mode.

public double getScaleFromZoomLevel (double level)

Returns a map scale value based on the specified zoom level.

public java.util.List <ViewObject> getSelectedObjects (PointF p)

Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.

public java.util.List <ViewObject> getSelectedObjects (ViewRect rect)

Returns the list of selectable ViewObject objects which are within a specified ViewRect.

public java.util.List <ViewObject> getSelectedObjectsNearby (PointF p)

Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.

public List getSupportedMapDisplayLanguages ()

Get the list of supported display languages.

public float getTilt ()

Returns the current tilt angle for this Map , in degrees.

public PointF getTransformCenter ()

Returns the current center coordinate for Map transformations such as zooming and rotation.

public java.util.EnumSet <LayerCategory> getVisibleLayers ()

Get the set of Map layers being rendered.

public int getWidth ()

Returns the current width of this Map , in number of pixels.

public double getZoomLevel ()

Returns the current zoom level, which will be within a range between getMinZoomLevel() and getMaxZoomLevel().

public static boolean isMaximumFpsLimited ()

Function to check if the FPS draw limit is enabled or not.

public boolean isStreetLevelCoverageVisible ()

Returns a boolean indicating whether street level coverage is visible.

public boolean isTrafficInfoVisible ()

Returns a boolean indicating whether traffic information is currently visible on the Map .

public void pan (PointF from, PointF to)

Moves the map from one specified screen pixel coordinates to another in a linear motion.

public GeoCoordinate pixelToGeo (PointF point)

Converts and returns GeoCoordinate from screen pixel coordinates.

public GeoCoordinate pixelToGeo (PointF point, float altitude)

Converts and returns GeoCoordinate from screen pixel coordinates at specific altitude.

public java.util.List <GeoCoordinate> pixelToGeo (List points)

Converts and returns a list of GeoCoordinate objects from a List of screen pixel coordinates.

public PixelResult projectToPixel (GeoCoordinate coordinate)

Converts and returns a PixelResult that represents screen pixel coordinates from a GeoCoordinate.

public java.util.List <PixelResult> projectToPixel (java.util.List <GeoCoordinate> coordinates)

Converts and returns a list of Map.PixelResult elements that represent screen pixel coordinates from a List of GeoCoordinate objects.

public void removeClusterLayer (ClusterLayer layer)

Detaches the cluster from the map.

public boolean removeCustomizableScheme (String schemeName)

Remove customizable scheme.

public boolean removeMapObject (MapObject object)

Removes a MapObject from this Map .

public boolean removeMapObjects (java.util.List <MapObject> objects)

Removes a List of multiple MapObject objects from this Map .

public boolean removeMapOverlay (MapOverlay overlay)

Removes a MapOverlay from this Map .

public boolean removeRasterTileSource (MapRasterTileSource source)

Removes a user-defined MapRasterTileSource from this Map .

public void removeSchemeChangedListener (OnSchemeChangedListener listener)

Removes an existing Map.OnSchemeChangedListener.

public void removeTransformListener (OnTransformListener listener)

Removes an existing Map.OnTransformListener from this Map .

public Map setCartoMarkersVisible (boolean visible)

Show or hide all MapCartoMarkers on Map .

public Map setCartoMarkersVisible (IconCategory category, boolean visible)

Toggles the visibility of a particular POI category's MapCartoMarkers.

public void setCenter (GeoCoordinate point, Animation animation, double level, float orientation, float tilt)

Moves the center of this Map to a specific GeoCoordinate, while simultaneously setting a zoom level (a fraction within the range of minimum and maximum levels), orientation (from 0 degrees to 360 degrees), and tilt (within the range of minimum and maximum tilt angles).

public void setCenter (GeoCoordinate point, Animation animation)

Moves the center of this Map to the specified GeoCoordinate using the given Map.Animation.

public void setCenter (PointF newCenter, Animation animation, double zoomLevel, float orientation, float tilt)

Centers the map at the specified screen pixel coordinates.

public static void setCustomMapConfiguration (String pathToConfigFile, String pathToResourceFile)

Set a custom map style configuration.

public boolean setExtrudedBuildingsVisible (boolean visible)

Show or hide the extruded buildings layer on this map.

public Map setFadingAnimations (boolean enabled)

Enable or disable animations for labels and icons shown on the map.

public Map setFleetFeaturesVisible (java.util.EnumSet <FleetFeature> features)

Set a set of fleet features to be visible.

public void setInfoBubbleAdapter (InfoBubbleAdapter adapter)

Deprecated: As of SDK 3.1.2.

Sets the custom info bubble adapter for this map.

public Map setLandmarksVisible (boolean visible)

Sets 3D landmarks to be either visible or invisible for this Map .

public boolean setMapDisplayLanguage (Locale language)

Set the map display language using a locale.

public Map setMapScheme (String scheme)

Sets a scheme for the Map to the specified String value.

public Map setMapScheme (CustomizableScheme customizableScheme)

Sets a scheme for the Map to the specified customizable scheme.

public boolean setMapSecondaryDisplayLanguage (Locale language)

Set the map secondary display language using a locale.

public static void setMaximumFps (int fps)

Function to set the maximum drawing frames-per-second.

public Map setOrientation (float angle)

Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees.

public void setOrientation (float angle, Animation animation)

Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees.

public Map setPedestrianFeaturesVisible (java.util.EnumSet <PedestrianFeature> features)

Set a set of pedestrian features to be visible.

public Map setProjectionMode (Projection projection)

Change the projection mode used to render the map.

public void setSafetySpotsVisible (boolean visible)

Sets safety spots visible.

public Map setStreetLevelCoverageVisible (boolean visible)

Sets street level coverage to be either visible or invisible for the Map .

public Map setTilt (float angle)

Sets a tilt angle for this Map , in degrees.

public void setTilt (float angle, Animation animation)

Sets a tilt angle for the Map , in degrees.

public Map setTrafficInfoVisible (boolean visible)

Sets traffic information to be either visible or invisible for this Map .

public Map setTransformCenter (PointF center)

Sets a center coordinate for Map transformations such as zooming and rotation.

public boolean setUseSystemLanguage ()

Set the map display language using the system default locale.

public Map setVisibleLayers (java.util.EnumSet <LayerCategory> layers, boolean enable)

Toggles the visibility of the map layer categories to be rendered.

public Map setZoomLevel (double level)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels.

public void setZoomLevel (double level, Animation animation)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels.

public void setZoomLevel (double level, PointF focus, Animation animation)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels while keeping the specified screen coordinate at the same Geographical Location.

public void zoomTo (GeoBoundingBox geoRect, Animation animation, float orientation)

Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given orientation.

public void zoomTo (GeoBoundingBox geoRect, Animation animation, float orientation, float tilt)

Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given orientation.

public void zoomTo (GeoBoundingBox geoRect, ViewRect viewPort, Animation animation, float orientation)

Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the provided ViewRect.

public void zoomTo (GeoBoundingBox geoRect, int width, int height, Animation animation, float orientation)

Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the specified pixel dimensions around the transform center.

Class Details

A Map object represents a virtual model of the world. When embedded in a MapFragment, or MapView, Map objects can be used to show maps, add/remove map objects, and enable user interactions.

Constructor Details

Map ()

Default Constructor

Field Details

public static final int ABSTRACT_CITY_MODEL

public static final int AIRPORT_AREA

public static final int AMUSEMENT_PARK

public static final int ANIMAL_PARK

public static final int BACKGROUND

public static final int BEACH

public static final int BORDER_BUILTUP

public static final int BORDER_COUNTRY

public static final int BORDER_LINE_OF_CONTROL

public static final int BORDER_REGIONAL

public static final int BORDER_STATE

public static final int BUILDING

public static final int BUILTUP

public static final int CEMETERY

public static final int CITY_PARK

public static final int DESERT

public static final int EXIT_SIGN

public static final int FERRY

public static final int GLACIER

public static final int GOLF_COURSE

public static final int HARBOR_AREA

public static final int HOSPITAL_CAMPUS

public static final int ICON_MOUNTAIN

public static final int ICON_PUBLIC_TRANSIT_STATION

public static final int INDUSTRIAL_COMPLEX

public static final int LABEL_AIRPORT_AREA

public static final int LABEL_AMUSEMENT_PARK

public static final int LABEL_ANIMAL_PARK

public static final int LABEL_BEACH

public static final int LABEL_BUILDING

public static final int LABEL_CEMETERY

public static final int LABEL_CITY_CAPITAL

public static final int LABEL_CITY_OTHER

public static final int LABEL_CITY_PARK

public static final int LABEL_CITY_STATE_CAPITAL

public static final int LABEL_CONTINENT

public static final int LABEL_DESERT

public static final int LABEL_FERRY

public static final int LABEL_GLACIER

public static final int LABEL_GOLF_COURSE

public static final int LABEL_HARBOR_AREA

public static final int LABEL_HOSPITAL_CAMPUS

public static final int LABEL_INDUSTRIAL_COMPLEX

public static final int LABEL_ISLAND

public static final int LABEL_MAJOR_COUNTRY

public static final int LABEL_MILITARY_BASE

public static final int LABEL_MINOR_COUNTRY

public static final int LABEL_MOUNTAIN

public static final int LABEL_NATIONAL_PARK

public static final int LABEL_NATIVE_RESERVATION

public static final int LABEL_NEIGHBORHOOD_AREA

public static final int LABEL_OCEAN

public static final int LABEL_PEDESTRIAN_AREA

public static final int LABEL_PUBLIC_TRANSIT_LINE

public static final int LABEL_PUBLIC_TRANSIT_STATION

public static final int LABEL_RAILYARD

public static final int LABEL_SEA

public static final int LABEL_SHOPPING_COMPLEX

public static final int LABEL_SPORTS_COMPLEX

public static final int LABEL_STATE

public static final int LABEL_STATE_ABBREVIATION

public static final int LABEL_STREET_CATEGORY_0

public static final int LABEL_STREET_CATEGORY_1

public static final int LABEL_STREET_CATEGORY_2

public static final int LABEL_STREET_CATEGORY_3

public static final int LABEL_STREET_CATEGORY_4

public static final int LABEL_STREET_CATEGORY_PEDESTRIAN

public static final int LABEL_STREET_CATEGORY_WALKWAY

public static final int LABEL_UNIVERSITY_CAMPUS

public static final int LABEL_WATER_OTHER

public static final int LABEL_WOODLAND

public static final int LAND

public static final int LAND_PARCEL

public static final int MILITARY_BASE

public static final float MOVE_PRESERVE_ORIENTATION

A valid orientation value that lies outside the minimum and maximum supported tilt range, used to indicate that the current orientation should be preserved. Pass this value to preserve the orientation when calling compound Map transform operations.

public static final float MOVE_PRESERVE_TILT

A valid tilt value that lies outside the range of getMinTilt(void) and getMaxTilt(void), used to indicate that the current tilt should be preserved. Pass this value to preserve the tilt when calling compound Map transform operations.

public static final double MOVE_PRESERVE_ZOOM_LEVEL

A valid zoom level value that lies outside the range of getMinZoomLevel() and getMaxZoomLevel(), used to indicate that the current zoom level should be preserved. Pass this value to preserve the zoom level when calling compound Map transform operations.

public static final int NATIONAL_PARK

public static final int NATIVE_RESERVATION

public static final int NEIGHBORHOOD_AREA

public static final int OUTLINE_MILITARY_BASE

public static final int OUTLINE_NATIONAL_PARK

public static final int OUTLINE_NATIVE_RESERVATION

public static final int PEDESTRIAN_AREA

public static final int PEDESTRIAN_FEATURE

public static final int POINT_ADDRESS

public static final int POI_ICON

public static final int POI_LABEL

public static final int PUBLIC_TRANSIT_LINE

public static final int RAILROAD

public static final int RAILYARD

public static final int RELIEF

public static final int ROADSIGN_ICON

public static final int SHOPPING_COMPLEX

public static final int SPORTS_COMPLEX

public static final int STREET_CATEGORY_0

public static final int STREET_CATEGORY_1

public static final int STREET_CATEGORY_2

public static final int STREET_CATEGORY_3

public static final int STREET_CATEGORY_4

public static final int STREET_CATEGORY_PEDESTRIAN

public static final int STREET_CATEGORY_WALKWAY

public static final int UNIVERSITY_CAMPUS

public static final int WATER

public static final int WOODLAND

Method Details

public void addClusterLayer (ClusterLayer layer)

Attaches cluster layer to the map. From this moment on the markers added to the layer will be also added to the map. After the layer is added clustering will happen automatically.

Parameters:

  • layer

    layer to add

Throws:

  • NullPointerException

    if null is passed as an argument

public boolean addMapObject (MapObject object)

Adds a MapObject to this Map .

Parameters:

  • object

    A MapObject to add

Returns:

True if the MapObject was added successfully, false otherwise (if the object has already been added, as duplicates are not allowed).

Throws:

  • NullPointerException

    if object is null.

See also:

addMapObjects(List<MapObject>)

removeMapObject(MapObject)

public boolean addMapObjects (java.util.List <MapObject> objects)

Adds a List of multiple MapObject objects to this Map .

Parameters:

  • objects

    A List of MapObject objects to add

Returns:

True if all the MapObjects in the List were added successfully, false otherwise (if any of the objects have already been added, as duplicates are not allowed).

Throws:

  • NullPointerException

    if objects is null

See also:

addMapObject(MapObject)

removeMapObjects(List<MapObjects>)

public boolean addMapOverlay (MapOverlay overlay)

Adds a MapOverlay to this Map .

Parameters:

  • overlay

    A MapOverlay to add.

Returns:

True if the MapOverlay was added successfully, false otherwise.

Throws:

  • NullPointerException

    if overlay is null

See also:

removeMapOverlay(MapOverlay)

public boolean addRasterTileSource (MapRasterTileSource source)

Adds a user-defined MapRasterTileSource to this Map .

Parameters:

  • source

    A MapRasterTileSource representing a user-defined raster tile source

Returns:

True if the raster tile source was added successfully, false otherwise

See also:

removeRasterTileSource(MapRasterTileSource)

public void addSchemeChangedListener (OnSchemeChangedListener listener)

Adds a Map.OnSchemeChangedListener to listen for map scheme change events.

Parameters:

See also:

removeTransformListener(OnTransformListener)

public void addTransformListener (OnTransformListener listener)

Adds a Map.OnTransformListener to this Map to listen for map transform events.

Parameters:

See also:

removeTransformListener(OnTransformListener)

public boolean areCartoMarkersVisible ()

Returns a boolean indicating whether all MapCartoMarkers of all IconCategory are visible.

This is equivalent to calling areCartoMarkersVisible(IconCategory) with IconCategory.ALL .

Returns:

true if MapCartoMarkers of all IconCategory are visible, false otherwise.

public boolean areCartoMarkersVisible (IconCategory category)

Get if MapCartoMarkers of a certain POI category is shown.

Parameters:

Returns:

true if the MapCartoMarkers of the specified category is visible, false otherwise.

public boolean areExtrudedBuildingsVisible ()

Returns a boolean indicating whether the extruded buildings layer is shown on this map.

Returns:

true if shown, false otherwise.

public boolean areLandmarksVisible ()

Returns a boolean indicating whether 3D landmarks are currently visible.

Returns:

True if landmarks are visible, false otherwise

public boolean areSafetySpotsVisible ()

Gets the current visibility of safety spots.

Returns:

true if safety spot visibility has been enabled.

public static int convert (LayerCategory cat)

Parameters:

  • cat

public CustomizableScheme createCustomizableScheme (String newSchemeName, String baseSchemeName)

Creates a customizable scheme based on an existing Map.Scheme. Please note that created schemes are destroyed when the application life cycle ends.

Parameters:

  • newSchemeName

    Name of the new scheme which you want to create.

  • baseSchemeName

    Name of base scheme. New scheme will be derived from this base scheme. Base scheme should be one from getMapSchemes()

Returns:

A customizable Scheme Instance.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

  • NullPointerException

    if newSchemeName OR baseSchemeName is null.

  • InvalidParameterException

    if baseSchemeName is not valid OR newSchemeName already exist.

public static void enableMaximumFpsLimit (boolean isLimited)

Function to enable/disable the FPS draw limit. When enabled, the redraw of the map will be limited to the value set using setMaximumFps(int). When disabled, the redraw rate will be hardware limited.

Parameters:

  • isLimited

    True if FPS limiting is to be enabled. False, to disable limiting.

public void executeSynchronized (Runnable task)

Execute a batched set of commands to the Map . This is useful to improve performance when multiple operations require re-rendering of the display.

Parameters:

  • task

    Task block to execute synchronously.

public GeoBoundingBox getBoundingBox ()

Returns the current visible map area as a GeoBoundingBox.

Note that a bounding box is always rectangular, and its sides are always parallel to latitude and longitude. If the map is rotated when this method is called (for example, if the orientation is 10 degrees east of true-north), the returned bounding box will be a circumscribed rectangle that is larger than the visible map area. Similarly, when the map is tilted (for example, if the map is tilted by 45 degrees), the visible map area represents a trapezoidal area in the world. Calling getBoundingBox() will then return a larger circumscribed rectangle that contains this trapezoid area.

The bounding box may be invalid when this method is called at low zoom levels, as the map area does not fill the screen.

Returns:

The GeoBoundingBox containing the visible map area.

public GeoCoordinate getCenter ()

Returns the GeoCoordinate location at the current center of this Map .

Returns:

The current map center

public String getCopyright ()

Returns the copyright notice text for this Map . This text is only available after Map completes rendering for the first time.

Returns:

The copyright notice

public CustomizableScheme getCustomizableScheme (String schemeName)

Retrieves a customizable scheme by using its name.

Parameters:

  • schemeName

    Name of customizable scheme name.

Returns:

A customizable Scheme Instance OR null if no scheme found.

Throws:

  • InvalidParameterException

    if scheme with this name is not configurable.

public java.util.EnumSet <FleetFeature> getFleetFeaturesVisible ()

Get the set of fleet features visible.

Returns:

The EnumSet of fleet features enabled

public int getHeight ()

Returns the current height of this Map , in number of pixels.

Returns:

The current height

public MapBuildingLayer getMapBuildingLayer ()

Returns the MapBuildingLayer for this Map . This layer enables user interactions with extruded buildings on the map.

Returns:

A MapBuildingLayer instance for this Map.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public String getMapDisplayLanguage ()

Get the language which the Map is set to render

Returns:

String MARC code of the displayed language.

public String getMapScheme ()

Returns the current scheme for the Map .

Returns:

The current scheme

See also:

Map.Scheme

getMapSchemes()

public List getMapSchemes ()

Returns a list containing all supported schemes for the Map .

Returns:

The supported schemes

See also:

Map.Scheme

getMapScheme()

setMapScheme(String)

public String getMapSecondaryDisplayLanguage ()

Get the secondary language which the Map is set to render

Returns:

String MARC code of the displayed language.

public MapState getMapState ()

Returns the current tilt, perspective, and zoom of the map as a MapState object.

Returns:

MapState object representing current state of the map.

public MapTrafficLayer getMapTrafficLayer ()

Get the MapTrafficLayer

Returns:

MapTrafficLayer

public MapTransitLayer getMapTransitLayer ()

Returns the MapTransitLayer associated with this Map .

Returns:

The MapTransitLayer

public float getMaxTilt ()

Returns the maximum degree allowed to be set as tilt angle for the Map .

Returns:

float maximum tilt angle in degrees.

public double getMaxZoomLevel ()

Returns the highest valid zoom level for Map , representing the closest view near the street-level

Returns:

The maximum zoom level

public static int getMaximumFps ()

Function to set the maximum drawing frames-per-second.

public float getMinTilt ()

Returns the minimum degree allowed to be set as tilt angle for the Map .

Returns:

float minimum tilt angle in degrees.

public double getMinZoomLevel ()

Returns the lowest valid zoom level for Map , representing the most distant view away from street-level.

Returns:

The minimum zoom level

public float getOrientation ()

Returns the current orientation for this Map , in degrees relative to true-north, which has an orientation of 0 degrees.

Returns:

The current orientation angle

public java.util.EnumSet <PedestrianFeature> getPedestrianFeaturesVisible ()

Get the set of pedestrian features visible.

Returns:

The EnumSet of Pedestrian features enabled

public PositionIndicator getPositionIndicator ()

Deprecated: As of SDK 3.3.

Use getPositionIndicator() instead.

Returns the PositionIndicator instance that renders the current position with a marker. The position indicator should be used with PositioningManager.

Returns:

The PositionIndicator

public Projection getProjectionMode ()

Gets the current map projection mode.

Returns:

Projection current projection mode.

public double getScaleFromZoomLevel (double level)

Returns a map scale value based on the specified zoom level. Scale units are in physical geo centimeters per screen inch.

Parameters:

  • level

    The zoom level to be translated to a map scale.

Returns:

Scale value for the passed level. Units are in geo centimeters per screen inch

public java.util.List <ViewObject> getSelectedObjects (PointF p)

Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.

Parameters:

  • p

    Screen pixel coordinate to check for ViewObject.

Returns:

The list of ViewObject objects at the pixel coordinate. If no object exists at p, returns an empty list.

public java.util.List <ViewObject> getSelectedObjects (ViewRect rect)

Returns the list of selectable ViewObject objects which are within a specified ViewRect.

Parameters:

  • rect

    A ViewRect with selected ViewObject objects

Returns:

The list of ViewObjects within the ViewRect. If no object exists within rect, returns an empty list.

public java.util.List <ViewObject> getSelectedObjectsNearby (PointF p)

Returns the list of selectable ViewObject instances which are located at the specified screen pixel coordinates.

Parameters:

  • p

    Screen pixel coordinate to check for ViewObject.

Returns:

The list of ViewObject objects at the pixel coordinate. If no object exists at p, returns an empty list.

public List getSupportedMapDisplayLanguages ()

Get the list of supported display languages.

Returns:

a list of supported map display languages

public float getTilt ()

Returns the current tilt angle for this Map , in degrees.

Returns:

The current tilt angle

public PointF getTransformCenter ()

Returns the current center coordinate for Map transformations such as zooming and rotation. The transform center may be different than the Map center.

Returns:

The PointF representing the current center used for transformations

public java.util.EnumSet <LayerCategory> getVisibleLayers ()

Get the set of Map layers being rendered.

Returns:

An EnumSet identifying the rendered layers.

public int getWidth ()

Returns the current width of this Map , in number of pixels.

Returns:

The current width

public double getZoomLevel ()

Returns the current zoom level, which will be within a range between getMinZoomLevel() and getMaxZoomLevel(). The zoom level is only precise to three decimal places due to numerical operations performed internally when rendering the map.

Returns:

The zoom level within the fractional range

public static boolean isMaximumFpsLimited ()

Function to check if the FPS draw limit is enabled or not.

Returns:

True if FPS draw limit is enabled. False otherwise.

public boolean isStreetLevelCoverageVisible ()

Returns a boolean indicating whether street level coverage is visible.

Returns:

True if street level coverage is visible, false otherwise

public boolean isTrafficInfoVisible ()

Returns a boolean indicating whether traffic information is currently visible on the Map .

Returns:

True if traffic information is visible, false otherwise

public void pan (PointF from, PointF to)

Moves the map from one specified screen pixel coordinates to another in a linear motion.

Parameters:

  • from

    A PointF representing the screen pixel coordinates to pan the map from.

  • to

    A PointF representing the screen pixel coordinates to pan the map to.

public GeoCoordinate pixelToGeo (PointF point)

Converts and returns GeoCoordinate from screen pixel coordinates.

This method returns null if the conversion fails. (For example, if the coordinate is not a valid value.)

Parameters:

  • point

    The screen pixel coordinates to convert

Returns:

A GeoCoordinate representing the map location. null if the conversion fails.

See also:

pixelToGeo(PointF, float)

pixelToGeo(List<PointF>)

public GeoCoordinate pixelToGeo (PointF point, float altitude)

Converts and returns GeoCoordinate from screen pixel coordinates at specific altitude.

This method returns null if the conversion fails. (For example, if the coordinate is not a valid value.)

Parameters:

  • point

    The screen pixel coordinates to convert

  • altitude

    A height in meters on which GeoCoordinate need to be calculated.

Returns:

A GeoCoordinate representing the map location. null if the conversion fails.

See also:

pixelToGeo(PointF)

pixelToGeo(List<PointF>)

public java.util.List <GeoCoordinate> pixelToGeo (List points)

Converts and returns a list of GeoCoordinate objects from a List of screen pixel coordinates.

This method returns one or more list elements as null if the conversion of the corresponding pixel coordinates fails.

Parameters:

  • points

    A List of screen pixel coordinates to convert

Returns:

A list of GeoCoordinate or null elements.

See also:

pixelToGeo(PointF)

pixelToGeo(PointF, float)

public PixelResult projectToPixel (GeoCoordinate coordinate)

Converts and returns a PixelResult that represents screen pixel coordinates from a GeoCoordinate. This method is converts a GeoCoordinate from world space to screen space.

Parameters:

  • coordinate

    A GeoCoordinate to convert

Returns:

A PixelResult representing screen pixel coordinates and operation success code. Check PixelResult#getError() to check the success of the conversion.

See also:

projectToPixel(List<GeoCoordinate>)

public java.util.List <PixelResult> projectToPixel (java.util.List <GeoCoordinate> coordinates)

Converts and returns a list of Map.PixelResult elements that represent screen pixel coordinates from a List of GeoCoordinate objects.

This method returns one or more list elements as null if the conversion of the corresponding GeoCoordinate instances fails.

Parameters:

  • coordinates

    A List of GeoCoordinate objects to convert

Returns:

The list of PixelResult results. Check PixelResult#getError() to check the success of each conversion.

See also:

projectToPixel(GeoCoordinate)

public void removeClusterLayer (ClusterLayer layer)

Detaches the cluster from the map. After this call completes markers on this layer will be removed from the map.

Parameters:

  • layer

    layer to remove

public boolean removeCustomizableScheme (String schemeName)

Remove customizable scheme. Please note that the current scheme cannot be removed.

Parameters:

  • schemeName

    Name of the scheme which you want to remove.

Returns:

Boolean indicating scheme has been removed successfully.

Throws:

  • NullPointerException

    if schemeName is null.

  • InvalidParameterException

    if schemeName is not valid OR not removable.

public boolean removeMapObject (MapObject object)

Removes a MapObject from this Map .

Parameters:

  • object

    A MapObject to remove

Returns:

True if the MapObject was removed successfully, false otherwise

See also:

removeMapObjects(List<MapObject>)

public boolean removeMapObjects (java.util.List <MapObject> objects)

Removes a List of multiple MapObject objects from this Map .

Parameters:

  • objects

    A List of MapObject objects to remove

Returns:

True if all the MapObjects in the List were removed successfully, false otherwise

See also:

removeMapObject(MapObject)

public boolean removeMapOverlay (MapOverlay overlay)

Removes a MapOverlay from this Map .

Parameters:

  • overlay

    A MapOverlay to remove

Returns:

True if the MapOverlay was removed successfully, false otherwise.

Throws:

  • NullPointerException

    if overlay is null

public boolean removeRasterTileSource (MapRasterTileSource source)

Removes a user-defined MapRasterTileSource from this Map .

Parameters:

Returns:

True if the raster tile source was removed successfully, false otherwise

public void removeSchemeChangedListener (OnSchemeChangedListener listener)

Removes an existing Map.OnSchemeChangedListener.

Parameters:

public void removeTransformListener (OnTransformListener listener)

Removes an existing Map.OnTransformListener from this Map .

Parameters:

public Map setCartoMarkersVisible (boolean visible)

Show or hide all MapCartoMarkers on Map .

Parameters:

  • visible

    Whether the MapCartoMarkers should be visible.

Returns:

The updated Map.

public Map setCartoMarkersVisible (IconCategory category, boolean visible)

Toggles the visibility of a particular POI category's MapCartoMarkers. To toggle visibility for IconCategory.ALL categories, setCartoMarkersVisible(boolean) can also be used.

Parameters:

  • category

    See IconCategory for category list.

  • visible

    Intended visibility for the specific POI category's MapCartoMarkers.

Returns:

The updated Map itself.

public void setCenter (GeoCoordinate point, Animation animation, double level, float orientation, float tilt)

Moves the center of this Map to a specific GeoCoordinate, while simultaneously setting a zoom level (a fraction within the range of minimum and maximum levels), orientation (from 0 degrees to 360 degrees), and tilt (within the range of minimum and maximum tilt angles). If you wish to keep the current zoom level, orientation, or tilt after setting a new center, pass one or more of the following values as the relevant parameter:

Note: it is unlikely that you would pass all three of the special MOVE_PRESERVE_ZOOM_LEVEL, MOVE_PRESERVE_ORIENTATION and MOVE_PRESERVE_TILT parameters when calling this method (it would make more sense to call setCenter(GeoCoordinate, Animation)). More likely, you would use one or two of the special parameters (for example, change the orientation and tilt along with the center coordinate while keeping the current zoom level).

Parameters:

  • point

    A GeoCoordinate representing the new center

  • animation

    A Map.Animation to illustrate the transformation

  • level

    Desired zoom level of the newly-centered Map (pass MOVE_PRESERVE_ZOOM_LEVEL to keep the current level)

  • orientation

    Desired orientation of the newly-centered Map (pass MOVE_PRESERVE_ORIENTATION to keep the current orientation)

  • tilt

    Desired tilt angle of the newly-centered Map (pass MOVE_PRESERVE_TILT to keep the current tilt)

See also:

setCenter(GeoCoordinate, Animation)

getMaxZoomLevel()

getMinZoomLevel()

getMaxTilt()

getMinTilt()

public void setCenter (GeoCoordinate point, Animation animation)

Moves the center of this Map to the specified GeoCoordinate using the given Map.Animation.

Parameters:

  • point

    A GeoCoordinate representing the new center

  • animation

    An Animation to illustrate the transformation

See also:

setCenter(GeoCoordinate, Animation, double, float, float)

public void setCenter (PointF newCenter, Animation animation, double zoomLevel, float orientation, float tilt)

Centers the map at the specified screen pixel coordinates. The zoom level, orientation and tilt angle be adjusted at the same time.

Parameters:

  • newCenter

    A PointF representing the screen pixel coordinates to set as map center.

  • animation

    An Animation to illustrate the transformation

  • zoomLevel

    Desired zoom level of the newly-centered Map. Use MOVE_PRESERVE_ZOOM_LEVEL to keep the current zoom level.

  • orientation

    Desired orientation of the newly-centered Map. Use MOVE_PRESERVE_ORIENTATION to keep the current orientation angle.

  • tilt

    Desired tilt angle of the newly-centered Map. Use MOVE_PRESERVE_TILT to keep the current tilt angle.

Throws:

  • IllegalArgumentException

    if unsupported zoom level or orientation angel is specified.

See also:

setCenter(GeoCoordinate, Animation, double, float, float)

public static void setCustomMapConfiguration (String pathToConfigFile, String pathToResourceFile)

Set a custom map style configuration. The custom map style setting should be made before the first Map is created. Note: This API should only be used in consultation with HERE technical support.

Parameters:

  • pathToConfigFile

    Map Style Configuration File.

  • pathToResourceFile

    Map Style Resource File. Can be null where default file will be used.

Throws:

  • FileNotFoundException

public boolean setExtrudedBuildingsVisible (boolean visible)

Show or hide the extruded buildings layer on this map.

Parameters:

  • visible

    true to show extruded building, false otherwise

Returns:

boolean True if extruded build visibility has been changed successfully. False, otherwise.

public Map setFadingAnimations (boolean enabled)

Enable or disable animations for labels and icons shown on the map. Note: the fading animations property will take effect when the map is redrawn.

Parameters:

  • enabled

    true to enable animations (default), false to disable animations

Returns:

The updated Map.

public Map setFleetFeaturesVisible (java.util.EnumSet <FleetFeature> features)

Set a set of fleet features to be visible. Features not in the set will be set invisible. An empty set means no features are visible.

Parameters:

  • features

    A set of visible fleet features

Returns:

The updated Map itself.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public void setInfoBubbleAdapter (InfoBubbleAdapter adapter)

Deprecated: As of SDK 3.1.2.

Use MapOverlay instead.

Sets the custom info bubble adapter for this map.

Parameters:

  • adapter

    A custom implementation for the info bubble.

See also:

showInfoBubble()

public Map setLandmarksVisible (boolean visible)

Sets 3D landmarks to be either visible or invisible for this Map .

If the map scheme is set to any Hybrid or Satellite map schemes (such as SATELLITE_DAY or HYBRID_DAY), this method will have no visible effect.

Parameters:

  • visible

    A boolean specifying whether 3D landmarks should be visible

Returns:

The updated Map.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public boolean setMapDisplayLanguage (Locale language)

Set the map display language using a locale. Causes a map redraw when language is set.

When this method is called, it will override the device's current locale until the device's locale is changed. This language change does not affect other features like search.

Parameters:

Returns:

true if the language is accepted by the Map, false otherwise.

public Map setMapScheme (String scheme)

Sets a scheme for the Map to the specified String value.

Parameters:

Returns:

The updated Map.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

See also:

Map.Scheme

getMapSchemes()

public Map setMapScheme (CustomizableScheme customizableScheme)

Sets a scheme for the Map to the specified customizable scheme.

Parameters:

  • customizableScheme

    CustomizableScheme instance.

Returns:

The updated Map.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

See also:

Map.Scheme

getMapSchemes()

public boolean setMapSecondaryDisplayLanguage (Locale language)

Set the map secondary display language using a locale. Causes a map redraw when language is set. Passing null will cause the display of secondary language to be disabled.

Setting a secondary display language will cause the language to be displayed below the primary language for some map labels (e.g. countries).

Parameters:

Returns:

true if the language is accepted by the Map, false otherwise.

See also:

setMapDisplayLanguage(Locale)

public static void setMaximumFps (int fps)

Function to set the maximum drawing frames-per-second. The FPS rate is used if enableMaximumFpsLimit(boolean) is enabled.

Parameters:

  • fps

    Frames-per-second (must be greater then zero)

public Map setOrientation (float angle)

Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees. No animation will be used to illustrate the transformation.

Parameters:

  • angle

    Desired orientation angle

Returns:

The updated Map.

See also:

setOrientation(float, Animation)

public void setOrientation (float angle, Animation animation)

Sets an absolute orientation for this Map to the specified angle, in degrees, where true-north is 0 degrees.

Note: animation is only visible for BOW. No animation is performed for LINEAR and NONE.

Parameters:

  • angle

    Desired orientation angle

  • animation

    An Animation to illustrate the transformation

See also:

setOrientation(float)

public Map setPedestrianFeaturesVisible (java.util.EnumSet <PedestrianFeature> features)

Set a set of pedestrian features to be visible. Features not in the set will be set invisible. An empty set means no features are visible

Parameters:

  • features

    A set of visible pedestrian features

Returns:

The updated Map itself.

public Map setProjectionMode (Projection projection)

Change the projection mode used to render the map.

Parameters:

  • projection

    The new projection mode.

Returns:

Map builder pattern

Throws:

  • IllegalArgumentException

    if deprecated Map.Projection modes are used.

public void setSafetySpotsVisible (boolean visible)

Sets safety spots visible.

Parameters:

  • visible

    true for visible, false to hide.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public Map setStreetLevelCoverageVisible (boolean visible)

Sets street level coverage to be either visible or invisible for the Map .

Parameters:

  • visible

    A boolean specifying whether street level coverage should be visible

Returns:

The updated Map.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public Map setTilt (float angle)

Sets a tilt angle for this Map , in degrees.

Parameters:

Returns:

The updated Map.

See also:

setTilt(float, Animation)

getMinTilt()

getMaxTilt()

public void setTilt (float angle, Animation animation)

Sets a tilt angle for the Map , in degrees.

Note: The tilt animation is not cancelled when other map operations (for example, setCenter(GeoCoordinate, Animation)) are performed. Therefore, the tilt animation can occur concurrently with other animations.

Parameters:

  • angle

    Desired tilt angle. Acceptable values are the range between getMinTilt(void) and getMaxTilt(void) inclusive.

  • animation

    An Animation to illustrate the transformation

See also:

setTilt(float)

getMinTilt()

getMaxTilt()

public Map setTrafficInfoVisible (boolean visible)

Sets traffic information to be either visible or invisible for this Map .

Traffic can only be displayed on one Map at a time. It is recommended that you turn off traffic display on other Maps before enabling traffic display on a new Map otherwise the results may be unpredictable. If multiple Maps are shown at the same time with setTrafficInfoVisible true, only one will display traffic.

Parameters:

  • visible

    A boolean specifying whether traffic information should be visible

Returns:

The modified Map itself.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public Map setTransformCenter (PointF center)

Sets a center coordinate for Map transformations such as zooming and rotation. Transformations performed after calling this method will be based on this new center coordinate. The transform center may be different than the Map center.

Parameters:

  • center

    A PointF representing the center used for transformations

Returns:

The updated Map

public boolean setUseSystemLanguage ()

Set the map display language using the system default locale. Causes a map redraw when language is set.

Returns:

true if the language update is accepted by the Map, false otherwise.

public Map setVisibleLayers (java.util.EnumSet <LayerCategory> layers, boolean enable)

Toggles the visibility of the map layer categories to be rendered.

By default, all layer categories are enabled.

Parameters:

  • layers

    EnumSet of layers to change visibility.

  • enable

    true to render, false to not render

Returns:

The updated Map itself.

public Map setZoomLevel (double level)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels. No animation will be used to illustrate the transformation.

Legal values are the range between getMinZoomLevel() and getMaxZoomLevel(), inclusive.

If this method is called before map animation has finished (for example, if you had called setCenter(GeoCoordinate, Animation)), the existing animation may be stopped and the map will proceed directly to change the zoom level. Consider using other methods that combine multiple actions to avoid unintentionally canceling map animations. For example, use setCenter(GeoCoordinate, Animation, double, float, float).

Note: The zoom level is only precise to three decimal places due to numerical operations performed internally when rendering the map.

Parameters:

  • level

    Desired fractional zoom level

Returns:

The updated Map.

See also:

setZoomLevel(double, Animation)

setZoomLevel(double, PointF, Animation)

getMinZoomLevel()

getMaxZoomLevel()

public void setZoomLevel (double level, Animation animation)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels.

Legal values are the range between getMinZoomLevel() and getMaxZoomLevel() inclusive.

If this method is called before map animation is finished (for example, if you had called setCenter(GeoCoordinate, Animation)), the existing animation may be stopped and the map will proceed directly to change the zoom level. Consider using other methods that combine multiple actions to avoid unintentionally canceling map animations. For example, use setCenter(GeoCoordinate, Animation, double, float, float).

Note: The zoom level is only precise to three decimal places due to numerical operations performed internally when rendering the map.

Parameters:

  • level

    Desired fractional zoom level

  • animation

    An Animation to illustrate the transformation

See also:

setZoomLevel(double)

setZoomLevel(double, PointF, Animation)

getMinZoomLevel()

getMaxZoomLevel()

public void setZoomLevel (double level, PointF focus, Animation animation)

Sets a zoom level for the Map to a fraction that is within the range of minimum and maximum zoom levels while keeping the specified screen coordinate at the same Geographical Location. Concretely, the GeoCoordinate of the specified PointF is the same before and after the transformation.

Legal values are the range between getMinZoomLevel() and getMaxZoomLevel() inclusive.

For the purposes of calculating the focus GeoCoordinate , the tilt of the map is considered to be 0. The actual map tilt will not change.

Note: do not call this method before setting the map is initialized. If you call this method while either getWidth() or getHeight() returns 0 it will throw a RuntimeException .

Note: The zoom level is only precise to three decimal places due to numerical operations performed internally when rendering the map.

Parameters:

  • level

    Desired fractional zoom level

  • focus

    A PointF to keep fixed, in pixel coordinates.

  • animation

    An Animation to illustrate the transformation

See also:

setZoomLevel(double)

setZoomLevel(double, Animation)

getMinZoomLevel()

getMaxZoomLevel()

public void zoomTo (GeoBoundingBox geoRect, Animation animation, float orientation)

Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given orientation.

Do not call this method before this map instance is initialized. If you call this method while this map is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please note the effects of this method will apply on Map slightly after the method invocation.

Parameters:

  • geoRect

    A GeoBoundingBox to show after the transformation

  • animation

    An Animation to illustrate the transformation

  • orientation

    Desired orientation of the Map (Use MOVE_PRESERVE_ORIENTATION to keep the current orientation)

See also:

zoomTo(GeoBoundingBox, ViewRect, Animation, float)

zoomTo(GeoBoundingBox, int, int, Animation, float)

public void zoomTo (GeoBoundingBox geoRect, Animation animation, float orientation, float tilt)

Moves this Map instance's map center and changes the zoom level to show the specified GeoBoundingBox at the given orientation.

Do not call this method before this map instance is initialized. If you call this method while this map is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please note the effects of this method will apply on Map slightly after the method invocation.

Parameters:

  • geoRect

    A GeoBoundingBox to show after the transformation

  • animation

    An Animation to illustrate the transformation

  • orientation

    Desired orientation of the Map (Use MOVE_PRESERVE_ORIENTATION to keep the current orientation)

  • tilt

See also:

zoomTo(GeoBoundingBox, ViewRect, Animation, float)

zoomTo(GeoBoundingBox, int, int, Animation, float)

public void zoomTo (GeoBoundingBox geoRect, ViewRect viewPort, Animation animation, float orientation)

Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the provided ViewRect.

Do not call this method before this map instance is initialized. If you call this method while this map is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please note the effects of this method will apply on Map slightly after the method invocation.

Parameters:

  • geoRect

    A GeoBoundingBox to show after the transformation

  • viewPort

    A ViewRect representing the view port into which the GeoBoundingBox fits. The ViewRect is interpreted as being in the same MapFragment as this Map instance.

  • animation

    An Animation to illustrate the transformation

  • orientation

    Desired orientation of the Map (pass MOVE_PRESERVE_ORIENTATION to keep the current orientation)

See also:

zoomTo(GeoBoundingBox, Animation, float)

zoomTo(GeoBoundingBox, int, int, Animation, float)

public void zoomTo (GeoBoundingBox geoRect, int width, int height, Animation animation, float orientation)

Moves this Map instance and changes its zoom level to show the specified GeoBoundingBox within the specified pixel dimensions around the transform center.

Do not call this method before this map instance is initialized. If you call this method while this map is uninitialized (either getWidth() or getHeight() returns 0), it will throw a RuntimeException . Please note the effects of this method will apply on Map slightly after the method invocation.

Parameters:

  • geoRect

    A GeoBoundingBox to show after the transformation

  • width

    The width, in number of pixels, of the bounding area around the transform center, which the geoRect will fit into.

  • height

    The height, in number of pixels, of the bounding area around the transform center, which the geoRect will fit into.

  • animation

    An Animation to illustrate the transformation

  • orientation

    Desired orientation of the Map (pass MOVE_PRESERVE_ORIENTATION to keep the current orientation)

Throws:

  • IllegalArgumentException

    if width or height is less than or equal to 0

See also:

setTransformCenter(PointF)

zoomTo(GeoBoundingBox, Animation, float)

zoomTo(GeoBoundingBox, ViewRect, Animation, float)

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.