MapContentSettings
public class MapContentSettings
extension MapContentSettings: NativeBase
extension MapContentSettings: Hashable
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.
-
Traffic refresh period error exception
Declaration
Swift
public typealias TrafficRefreshPeriodError = TrafficRefreshPeriodErrorCode -
Traffic refresh period error code
See moreDeclaration
Swift
public enum TrafficRefreshPeriodErrorCode : UInt32, CaseIterable, Codableextension MapContentSettings.TrafficRefreshPeriodErrorCode : Error -
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(...)withMapFeatures.trafficIncidents.Declaration
Swift
public static func filterTrafficIncidents(trafficIncidents: [TrafficIncidentType])Parameters
trafficIncidentsThe 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
MapContentSettings.filterTrafficIncidents(...).trafficIncidentscontainsTrafficIncidentType.unknown, then the traffic filter will be applied ignoring this element. -
Removes all filters regarding Traffic Incidents so that all incidents will be displayed, when the display of Traffic Incidents is enabled using
MapScene.enableFeatures(...)withMapFeatures.trafficIncidents.Declaration
Swift
public static func resetTrafficIncidentFilter() -
Sets the traffic data refresh period for both
MapFeatures.trafficFlowandMapFeatures.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.Throws
MapContentSettings.TrafficRefreshPeriodErrorMapContentSettings.TrafficRefreshPeriodErrorindicates what went wrong.Declaration
Swift
public static func setTrafficRefreshPeriod(_ value: TimeInterval) throwsParameters
valueTraffic 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.
-
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.
Declaration
Swift
public static func resetTrafficRefreshPeriod()