GuidesChangelogHERE SDK API references
Guides

Add predefined map features

Add map features

In addition to map schemes, the HERE SDK supports specialized layers called MapFeatures. These features allow you to overlay additional data on the map.

MapFeatures can be configured with different MapFeatureModes to control its visual appearance. For example, 3D landmarks can be displayed using textured or non-textured modes. Landmarks are enabled by default for most map schemes.

To see which MapFeatures and MapFeatureModes are enabled by default for each MapScheme, refer to default features and modes per map scheme in the HERE Style Editor documentation.

Note

Note that not all MapFeatures are available for all licenses. Take a look at the API Reference to know which layers are supported for your licence.

Adding MapFeatures may have a performance impact.

Feature Description In Explore In Navigate
AMBIENT_OCCLUSION Ambient occlusion effect for 3D geometries (extruded buildings and landmarks). Yes Yes
BUILDING_FOOTPRINTS The 2D footprint of buildings. Yes Yes
CONGESTION_ZONES City areas designated as congestion zones (or congestion charge zones), which impose fees on entering such areas. Yes Yes
CONTOURS Show or hide contour lines on the map to represent elevation changes. No Yes
ENVIRONMENTAL_ZONES City areas designated as environmental zones, which empose limitations on the type of vehicles that are allowed to enter such areas. Yes Yes
EXTRUDED_BUILDINGS Simple 3D representation of buildings. Yes Yes
LANDMARKS 3D landmarks. No Yes
LOW_SPEED_ZONES City areas designated as low speed zones. Yes Yes
PUBLIC_TRANSIT Toggles the display of public transit lines for systems like subway, tram, train, monorail, and ferry, based on the selected mode. No Yes
ROAD_EXIT_LABELS Show or hide road exit labels, if available. Yes Yes
SAFETY_CAMERAS Safety and speed cameras. No Yes
SHADOWS Shadows for all building types (extruded buildings and landmarks). Yes Yes
TERRAIN Show elevation topography. No Yes
TRAFFIC_FLOW Traffic flow speed. Yes Yes
TRAFFIC_INCIDENTS Traffic incidents. Yes Yes
VEHICLE_RESTRICTIONS Vehicle restrictions. No Yes
TRAFFIC_LIGHTS Traffic lights. Yes Yes

Below you can see how the map feature layers can be enabled:

Map<String, String> mapFeatures = new HashMap<>();
mapFeatures.put(MapFeatures.BUILDING_FOOTPRINTS, MapFeatureModes.BUILDING_FOOTPRINTS_ALL);
mapFeatures.put(MapFeatures.CONTOURS, MapFeatureModes.CONTOURS_ALL);  // Only available with the Navigate license.
mapFeatures.put(MapFeatures.CONGESTION_ZONES, MapFeatureModes.CONGESTION_ZONES_ALL);
mapFeatures.put(MapFeatures.ENVIRONMENTAL_ZONES, MapFeatureModes.ENVIRONMENTAL_ZONES_ALL);
mapFeatures.put(MapFeatures.EXTRUDED_BUILDINGS, MapFeatureModes.EXTRUDED_BUILDINGS_ALL);
mapFeatures.put(MapFeatures.LANDMARKS, MapFeatureModes.LANDMARKS_TEXTURED); // Only available with the Navigate license.
mapFeatures.put(MapFeatures.ROAD_EXIT_LABELS, MapFeatureModes.ROAD_EXIT_LABELS_ALL); // Only available with the Navigate license.
mapFeatures.put(MapFeatures.SAFETY_CAMERAS, MapFeatureModes.DEFAULT);
mapFeatures.put(MapFeatures.SHADOWS, MapFeatureModes.SHADOWS_ALL);
mapFeatures.put(MapFeatures.TERRAIN, MapFeatureModes.DEFAULT); // Only available with the Navigate license.
mapFeatures.put(MapFeatures.TRAFFIC_FLOW, MapFeatureModes.DEFAULT);
mapFeatures.put(MapFeatures.TRAFFIC_INCIDENTS, MapFeatureModes.DEFAULT);
mapFeatures.put(MapFeatures.LOW_SPEED_ZONES, MapFeatureModes.LOW_SPEED_ZONES_ALL);
mapFeatures.put(MapFeatures.VEHICLE_RESTRICTIONS, MapFeatureModes.DEFAULT); // Only available with the Navigate license.
mapFeatures.put(MapFeatures.AMBIENT_OCCLUSION, MapFeatureModes.AMBIENT_OCCLUSION_ALL);
mapFeatures.put(MapFeatures.PUBLIC_TRANSIT, MapFeatureModes.PUBLIC_TRANSIT_ALL); // Only available with the Navigate license.
mapView.getMapScene().enableFeatures(mapFeatures);
val mapFeatures: MutableMap<String, String> = HashMap()
mapFeatures[MapFeatures.BUILDING_FOOTPRINTS] = MapFeatureModes.BUILDING_FOOTPRINTS_ALL
mapFeatures[MapFeatures.CONTOURS] = MapFeatureModes.CONTOURS_ALL
mapFeatures[MapFeatures.CONGESTION_ZONES] = MapFeatureModes.CONGESTION_ZONES_ALL
mapFeatures[MapFeatures.ENVIRONMENTAL_ZONES] = MapFeatureModes.ENVIRONMENTAL_ZONES_ALL
mapFeatures[MapFeatures.EXTRUDED_BUILDINGS] = MapFeatureModes.EXTRUDED_BUILDINGS_ALL
mapFeatures[MapFeatures.LANDMARKS] = MapFeatureModes.LANDMARKS_TEXTURED
mapFeatures[MapFeatures.ROAD_EXIT_LABELS] = MapFeatureModes.ROAD_EXIT_LABELS_ALL
mapFeatures[MapFeatures.SAFETY_CAMERAS] = MapFeatureModes.DEFAULT
mapFeatures[MapFeatures.SHADOWS] = MapFeatureModes.SHADOWS_ALL
mapFeatures[MapFeatures.TERRAIN] = MapFeatureModes.DEFAULT
mapFeatures[MapFeatures.TRAFFIC_FLOW] = MapFeatureModes.DEFAULT
mapFeatures[MapFeatures.TRAFFIC_INCIDENTS] = MapFeatureModes.DEFAULT
mapFeatures[MapFeatures.LOW_SPEED_ZONES] = MapFeatureModes.LOW_SPEED_ZONES_ALL
mapFeatures[MapFeatures.VEHICLE_RESTRICTIONS] = MapFeatureModes.DEFAULT
mapFeatures[MapFeatures.AMBIENT_OCCLUSION] = MapFeatureModes.AMBIENT_OCCLUSION_ALL
mapFeatures[MapFeatures.PUBLIC_TRANSIT] = MapFeatureModes.PUBLIC_TRANSIT_ALL
mapView!!.mapScene.enableFeatures(mapFeatures)

Note

When a new map scene is loaded (for example, when switching between different map schemes), all previously configured map features are reset to their default state. You must re-enable your desired map features after each scene load operation.

Setting a new layer state is performed synchronously, but it requires a valid map scene that must have been loaded before. Also, setting a new feature state while a new map scene is being loaded, may result in an exception.

Similarly, you can also disable a list of layers like shown below:

List<String> mapFeatures = new ArrayList<>();
mapFeatures.add(MapFeatures.TRAFFIC_FLOW);
mapFeatures.add(MapFeatures.TRAFFIC_INCIDENTS);
mapFeatures.add(MapFeatures.EXTRUDED_BUILDINGS);
mapFeatures.add(MapFeatures.AMBIENT_OCCLUSION);
mapView.getMapScene().disableFeatures(mapFeatures);
val mapFeatures: MutableList<String> = ArrayList()
mapFeatures.add(MapFeatures.TRAFFIC_FLOW)
mapFeatures.add(MapFeatures.TRAFFIC_INCIDENTS)
mapFeatures.add(MapFeatures.EXTRUDED_BUILDINGS)
mapFeatures.add(MapFeatures.AMBIENT_OCCLUSION)
mapView!!.mapScene.disableFeatures(mapFeatures)

Note

When TRAFFIC_FLOW and TRAFFIC_INCIDENTS features are enabled, then the HERE SDK will request new traffic information for each new vector tile - for example, by panning the viewport or zooming. This may lead to an increase of costs, depending on your plan. With MapContentSettings the traffic flow and incident refresh period can be adjusted, but this can be overwritten by viewport changes. During turn-by-turn navigation, this can happen multiple times per second and may result in a high number of Traffic Vector Tile requests. As an alternative, consider using TrafficOnRoute to update only the traffic visualization along the route itself.

Each map feature supports one or more alternative rendering options. With the Navigate license for example, instead of using TERRAIN_HILLSHADE, which is the default mode for TERRAIN, you can use TERRAIN_3D to show advanced topographical shading for hills on a true 3D terrain map view.

Below you can see screenshots for all map layers supported by the HERE SDK - note that not all feature layers are available for all licenses:

Screenshots (from left to right): MapFeatures.BUILDING_FOOTPRINTS combined with MapFeatureModes.BUILDING_FOOTPRINTS_ALL shows 2D footprints of buildings. MapFeatures.EXTRUDED_BUILDINGS combined with MapFeatureModes.EXTRUDED_BUILDINGS_ALL shows a 3D representation of buildings. MapFeatures.BUILDING_FOOTPRINTS and MapFeatures.EXTRUDED_BUILDINGS are enabled, by default. This is how it looks when they are disabled. Screenshots (from left to right): MapFeatures.LANDMARKS combined with MapFeatureModes.LANDMARKS_TEXTURED shows textured landmarks. When paired with MapFeatureModes.LANDMARKS_TEXTURELESS shows textureless landmarks. When paired with MapFeatureModes.LANDMARKS_GRAYSCALE shows landmark textures in grayscale. Screenshot: MapFeatures.CONTOURS with MapFeatureModes.CONTOURS_ALL shows contour lines on the map to represent elevation changes (only available with the Navigate license). Screenshots (from left to right): MapFeatures.CONGESTION_ZONES combined with MapFeatureModes.CONGESTION_ZONES_ALL shows city areas designated as congestion charge zones, marked as purple shade (Congestion charging zones are area where drivers are required to pay a fee to enter or travel within). MapFeatures.ENVIRONMENTAL_ZONES combined with MapFeatureModes.ENVIRONMENTAL_ZONES_ALL shows city areas designated as environmental zones, marked as teal shade (Environmental zones are low emission zone, a designated area in a city or region where access for certain vehicles is restricted). Screenshots (from left to right): MapFeatures.ROAD_EXIT_LABELS combined with the MapFeatureModes.ROAD_EXIT_LABELS_NUMBERS_ONLY shows the road exit labels in numbers. When paired with MapFeatureModes.ROAD_EXIT_LABELS_ALL shows the road exit labels in text (only available with the Navigate license). Screenshot: MapFeatures.SAFETY_CAMERAS with MapFeatureModes.SAFETY_CAMERAS_ALL shows speed warning cameras. Screenshot: MapFeatures.SHADOWS with MapFeatureModes.SHADOWS_ALL shows shadow for all building types (extruded buildings and landmarks). Screenshot: MapFeatures.TERRAIN with MapFeatureModes.TERRAIN_HILLSHADE shows topographical shading for hills (only available with the Navigate license). Screenshot: MapFeatures.TERRAIN with MapFeatureModes.TERRAIN_3D shows topographical shading for hills on a 3D terrain map (only available with the Navigate license). Screenshots (from left to right): MapFeatures.TRAFFIC_FLOW combined with MapFeatureModes.TRAFFIC_FLOW_WITH_FREE_FLOW shows active traffic jams on the streets by showing green lines when there is no traffic congestion. When paired with MapFeatureModes.TRAFFIC_FLOW_WITHOUT_FREE_FLOW, no green lines are shown when there is no traffic congestion. When paired with MapFeatureModes.TRAFFIC_FLOW_JAPAN_WITHOUT_FREE_FLOW, no green lines are shown when there is no traffic congestion. Screenshot: MapFeatures.TRAFFIC_INCIDENTS with MapFeatureModes.TRAFFIC_INCIDENTS_ALL shows incidents such as accidents, construction works, and more. Screenshots (from left to right): MapFeatures.VEHICLE_RESTRICTIONS combined with MapFeatureModes.VEHICLE_RESTRICTIONS_ACTIVE shows truck-specific information with only showing active restrictions. When paired with MapFeatureModes.VEHICLE_RESTRICTIONS_ACTIVE_AND_INACTIVE shows truck-specific information with showing active and inactive time-based restrictions. When paired with MapFeatureModes.VEHICLE_RESTRICTIONS_ACTIVE_AND_INACTIVE_DIFFERENTIATED shows truck-specific information with showing active and inactive time-based restrictions, but inactive time-based restrictions are shown as faded (only available with the Navigate license). Screenshot (from left to right): On the left, ambient occlusion is disabled, while on the right, ambient occlusion is enabled using MapFeatures.AMBIENT_OCCLUSION with MapFeatureModes.AMBIENT_OCCLUSION_ALL, showcasing the enhanced shadowing and depth effects. Screenshot: MapFeatures.PUBLIC_TRANSIT with MapFeatureModes.PUBLIC_TRANSIT_ALL (only available with the Navigate license). Screenshot: MapFeatures.TRUCK_PREFERRED_ROADS with MapFeatureModes.TRUCK_PREFERRED_ROADS_ALL (only available with the Navigate license). Screenshot: MapFeatures.TRAFFIC_LIGHTS with MapFeatureModes.TRAFFIC_LIGHTS_ALL

Some layers allow to filter the shown content via MapContentSettings:

  • MapFeatures.TRAFFIC_INCIDENTS: Use filterTrafficIncidents​(List<TrafficIncidentType> trafficIncidents) to filter the displayed traffic incidents.
  • MapFeatures.VEHICLE_RESTRICTIONS: Use configureVehicleRestrictionFilter​(TransportSpecification transportSpecs) to filter the displayed truck restrictions.

The map layers BUILDING_FOOTPRINTS & EXTRUDED_BUILDINGS are enabled by default on the MapView.

Beta Release: we now also support MapFeatureModes.TERRAIN_3D with day, night, hybrid day and hybrid night map schemes (only available with the Navigate license).

Screenshots (from left to right): MapScheme.DAY with MapFeatureModes.TERRAIN_3D, MapScheme.NIGHT with MapFeatureModes.TERRAIN_3D, MapScheme.HYBRID_DAY with MapFeatureModes.TERRAIN_3D, MapScheme.HYBRID_NIGHT with MapFeatureModes.TERRAIN_3D (only available with the Navigate license).

Extruded buildings coverage

When the MapFeatures.EXTRUDED_BUILDINGS feature is enabled, buildings will be rendered in 3D with an outline. The appearance of the buildings may vary by country. For example, in Japan, the outlines are combined sometimes with colored building walls.

By default, extruded buildings are supported for most countries.

Note that the enriched Japan map requires a separate contract with HERE.

Screenshots (from left to right): Extruded buildings for a non-Japan region, extruded buildings for the Japan map.

Try the MapFeatures example app

Most of the code snippets mentioned above are available in our "MapFeatures" example app, provided in both Java and Kotlin. You can find this example app on GitHub for your preferred platform.