Class MapContentSettings
Class MapContentSettings
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.mapview.MapContentSettings
-
public final class MapContentSettings extends NativeBase
Provides settings regarding map data which are applied globally to all map views. The settings can already be changed before a map view instance is created.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapContentSettings.TrafficRefreshPeriodErrorCodeTraffic refresh period error codestatic classMapContentSettings.TrafficRefreshPeriodExceptionTraffic refresh period error exception
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfilterTrafficIncidents(java.util.List<TrafficIncidentType> trafficIncidents)Filters the displayed traffic incidents so that only the ones applicable to the specified criteria are shown when general display of traffic incidents is enabled.static voidresetTrafficIncidentFilter()Removes all filters regarding Traffic Incidents so that all incidents will be displayed, when the display of Traffic Incidents is enabled usingMapScene.enableFeatures(java.util.Map<java.lang.String, java.lang.String>)withMapFeatures.TRAFFIC_INCIDENTS.static voidresetTrafficRefreshPeriod()Resets the traffic data (both flow and incidents) refresh period so the default traffic information validity time and the refresh period derived from the refresh period of the traffic server is used.static voidsetTrafficRefreshPeriod(Duration value)Sets the traffic data refresh period for bothMapFeatures.TRAFFIC_FLOWandMapFeatures.TRAFFIC_INCIDENTS.
-
-
-
Method Detail
-
filterTrafficIncidents
public static void filterTrafficIncidents(@NonNull java.util.List<TrafficIncidentType> trafficIncidents)Filters the displayed traffic incidents so that only the ones applicable to the specified criteria are shown when general display of traffic incidents is enabled. The display of traffic incidents can be enabled using
MapScene.enableFeatures(java.util.Map<java.lang.String, java.lang.String>)withMapFeatures.TRAFFIC_INCIDENTS.- Parameters:
trafficIncidents-The traffic incidents to filter for, so that only applicable incidents are displayed. When the list is empty, then all traffic incidents will be displayed. If the
trafficIncidentscontainsTrafficIncidentType.UNKNOWN, then the traffic filter will be applied ignoring this element.
-
resetTrafficIncidentFilter
public static void resetTrafficIncidentFilter()
Removes all filters regarding Traffic Incidents so that all incidents will be displayed, when the display of Traffic Incidents is enabled using
MapScene.enableFeatures(java.util.Map<java.lang.String, java.lang.String>)withMapFeatures.TRAFFIC_INCIDENTS.
-
setTrafficRefreshPeriod
public static void setTrafficRefreshPeriod(@NonNull Duration value) throws MapContentSettings.TrafficRefreshPeriodExceptionSets the traffic data refresh period for both
MapFeatures.TRAFFIC_FLOWandMapFeatures.TRAFFIC_INCIDENTS. By default, the traffic information validity time and the refresh period is derived from the refresh period of HERE's traffic server. The period set by this function will override the server's default setting for upcoming traffic data requests. Defaults to 60 seconds.- Parameters:
value-Traffic data refresh period in seconds. Valid range is [60, 300] seconds. The shortest refresh period that can be set is 60 seconds. This means that the traffic data shown on a map view will be refreshed every minute. The longest refresh period that can be set is 300 seconds. This means that the traffic data shown on the current map view will be refreshed every 5 minutes if the viewport does not change. Note that when a viewport change occurs, new traffic data may be requested regardless of the set refresh period. For example, during turn-by-turn navigation, frequent viewport changes can result in missing traffic data, causing new requests to be made more often.
- Throws:
MapContentSettings.TrafficRefreshPeriodException-MapContentSettings.TrafficRefreshPeriodExceptionindicates what went wrong.
-
resetTrafficRefreshPeriod
public static void resetTrafficRefreshPeriod()
Resets the traffic data (both flow and incidents) refresh period so the default traffic information validity time and the refresh period derived from the refresh period of the traffic server is used.
-
-