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
ambientOcclusion Ambient occlusion effect for 3D geometries (extruded buildings and landmarks). Yes Yes
buildingFootprints The 2D footprint of buildings. Yes Yes
congestionZones 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
environmentalZones City areas designated as environmental zones, which empose limitations on the type of vehicles that are allowed to enter such areas. Yes Yes
extrudedBuildings Simple 3D representation of buildings. Yes Yes
landmarks 3D landmarks. No Yes
lowSpeedZones City areas designated as low speed zones. Yes Yes
publicTransit Toggles the display of public transit lines for systems like subway, tram, train, monorail, and ferry, based on the selected mode. No Yes
roadExitLabels Show or hide road exit labels, if available. Yes Yes
safetyCameras Safety and speed cameras. No Yes
shadows Shadows for all building types (extruded buildings and landmarks). Yes Yes
terrain Show elevation topography. No Yes
trafficFlow Traffic flow speed. Yes Yes
trafficincidents Traffic incidents. Yes Yes
vehicleRestrictions Vehicle restrictions. No Yes
trafficLights Traffic lights. Yes Yes

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

_hereMapController.mapScene.enableFeatures({MapFeatures.buildingFootprints: MapFeatureModes.buildingFootprintsAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.contours: MapFeatureModes.contoursAll}); // Only available with the Navigate license.
_hereMapController.mapScene.enableFeatures({MapFeatures.congestionZones: MapFeatureModes.congestionZonesAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.environmentalZones: MapFeatureModes.environmentalZonesAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.extrudedBuildings: MapFeatureModes.defaultMode});
_hereMapController.mapScene.enableFeatures({MapFeatures.landmarks: MapFeatureModes.landmarksTextured}); // Only available with the Navigate license.
_hereMapController.mapScene.enableFeatures({MapFeatures.roadExitLabels: MapFeatureModes.roadExitLabelsAll}); // Only available with the Navigate license.
_hereMapController.mapScene.enableFeatures({MapFeatures.safetyCameras: MapFeatureModes.defaultMode});
_hereMapController.mapScene.enableFeatures({MapFeatures.shadows: MapFeatureModes.shadowsAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.terrain: MapFeatureModes.defaultMode}); // Only available with the Navigate license.
_hereMapController.mapScene.enableFeatures({MapFeatures.trafficFlow: MapFeatureModes.defaultMode});
_hereMapController.mapScene.enableFeatures({MapFeatures.trafficIncidents: MapFeatureModes.defaultMode});
_hereMapController.mapScene.enableFeatures({MapFeatures.lowSpeedZones: MapFeatureModes.lowSpeedZonesAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.vehicleRestrictions: MapFeatureModes.defaultMode}); // Only available with the Navigate license.
_hereMapController.mapScene.enableFeatures({MapFeatures.ambientOcclusion: MapFeatureModes.ambientOcclusionAll});
_hereMapController.mapScene.enableFeatures({MapFeatures.publicTransit: MapFeatureModes.publicTransitAll}); // Only available with the Navigate license.

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:

_hereMapController.mapScene.disableFeatures([MapFeatures.buildingFootprints, MapFeatures.extrudedBuildings, MapFeatures.ambientOcclusion]);

Note

When trafficFlow and trafficIncidents 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. For example, instead of using terrainHillshade, which is the default mode for terrain, you can use terrain3d 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.buildingFootprints combined with MapFeatureModes.buildingFootprintsAll shows 2D footprints of buildings. MapFeatures.extrudedBuildings combined with MapFeatureModes.extrudedBuildingsAll shows a 3D representation of buildings. MapFeatures.buildingFootprints and MapFeatures.extrudedBuildings are enabled by default. This is how it looks when they are disabled. Screenshots (from left to right): MapFeatures.landmarks combined with MapFeatureModes.landmarksTextured shows textured landmarks. When paired with MapFeatureModes.landmarksTextureless shows textureless landmarks. When paired with MapFeatureModes.landmarksGrayscale shows landmark textures in grayscale. Screenshot: MapFeatures.contours with MapFeatureModes.contoursAll shows contour lines on the map to represent elevation changes. (only available with the Navigate license) Screenshots (from left to right): MapFeatures.congestionZones combined with MapFeatureModes.congestionZonesAll 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.environmentalZones combined with MapFeatureModes.environmentalZonesAll 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.roadExitLabels combined with the MapFeatureModes.roadExitLabelsNumbersOnly shows the road exit labels in numbers. When paired with MapFeatureModes.roadExitLabelsAll shows the road exit labels in text. (only available with the Navigate license) Screenshot: MapFeatures.safetyCameras with MapFeatureModes.safetyCamerasAll shows speed warning cameras. Screenshot: MapFeatures.shadows with MapFeatureModes.shadowsAll shows shadow for all building types (extruded buildings and landmarks). Screenshot: MapFeatures.terrain with MapFeatureModes.terrainHillshade shows topographical shading for hills. (only available with the Navigate license) Screenshot: MapFeatures.terrain with MapFeatureModes.terrain3d shows topographical shading for hills on a 3D terrain map. (only available with the Navigate license) Screenshots (from left to right): MapFeatures.trafficFlow combined with MapFeatureModes.trafficFlowWithFreeFlow shows active traffic jams on the streets by showing green lines when there is no traffic congestion. When paired with MapFeatureModes.trafficFlowWithoutFreeFlow, no green lines are shown when there is no traffic congestion. When paired with MapFeatureModes.trafficFlowJapanWithoutFreeFlow, no green lines are shown when there is no traffic congestion. Screenshot: MapFeatures.trafficIncidents with MapFeatureModes.trafficIncidentsAll shows incidents such as accidents, construction works, and more. Screenshots (from left to right): MapFeatures.vehicleRestrictions combined with MapFeatureModes.vehicleRestrictionsActive shows truck-specific information with only showing active restrictions. When paired with MapFeatureModes.vehicleRestrictionsActiveAndInactive shows truck-specific information with showing active and inactive time-based restrictions. When paired with MapFeatureModes.vehicleRestrictionsActiveAndInactiveDifferentiated shows truck-specific information with showing active and inactive time-based restrictions, but inactive time-based restrictions are shown as faded. Screenshot (from left to right): On the left, ambient occlusion is disabled, while on the right, ambient occlusion is enabled using MapFeatures.ambientOcclusion with MapFeatureModes.ambientOcclusionAll, showcasing the enhanced shadowing and depth effects. Screenshot: MapFeatures.publicTransit with MapFeatureModes.publicTransitAll. (only available with the Navigate license) Screenshot: MapFeatures.truckPreferredRoads with MapFeatureModes.truckPreferredRoadsAll (only available with the Navigate license). Screenshot: MapFeatures.trafficLights with MapFeatureModes.trafficLightsAll

Some layers allow to filter the shown content via MapContentSettings:

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

The map layers buildingFootprints & extrudedBuildings are enabled by default on the MapView.

Beta Release: we now also support MapFeatureModes.terrain3d with day, night, hybrid day and hybrid night map schemes.

Screenshots (from left to right): MapScheme.day with MapFeatureModes.terrain3d, MapScheme.night with MapFeatureModes.terrain3d, MapScheme.hybridDay with MapFeatureModes.terrain3d, MapScheme.hybridNight with MapFeatureModes.terrain3d. (only available with the Navigate license)

Extruded buildings coverage

When the MapFeatures.extrudedBuildings 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.

Enable building shadows

The HERE SDK supports rendering building shadows, available only with non-satellite-based map schemes. To enable shadows for a MapView, use the following:

_mapFeatures[MapFeatures.shadows] = MapFeatureModes.shadowsAll;

// Sets the desired shadow quality for all instances of MapView.
HereMapController.shadowQuality = ShadowQuality.veryHigh;
_mapScene.enableFeatures(_mapFeatures);

If no shadow quality is configured, the feature has no effect and shadows are not rendered. Enabling shadows impacts performance and should be used only on devices with sufficient capability. Reduce the ShadowQuality if performance issues occur on your hardware setup.