setTrafficRefreshPeriod static method

void setTrafficRefreshPeriod(
  1. Duration value
)

Sets the traffic data refresh period for both MapFeatures.trafficFlow and MapFeatures.trafficIncidents.

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.

  • 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 MapContentSettingsTrafficRefreshPeriodExceptionException. MapContentSettingsTrafficRefreshPeriodExceptionException indicates what went wrong.

Implementation

static void setTrafficRefreshPeriod(Duration value) => $prototype.setTrafficRefreshPeriod(value);