currentRestrictions property
Set of RouteRestrictionType values active at the current position.
Describes the restrictions that apply to the part of the route the user is currently traveling on (for example access restricted, transport not allowed, vehicle over weight/height/length/width/axle limit, plate restriction).
Returns
Set<RouteRestrictionType>: Currently active restrictions; empty when no restriction is active.
See also:
- RouteRestrictionType - Enumeration of restriction kinds.
- TurnDetails.restrictions - Restrictions associated with an individual turn.
- NavigationInstructionUpdateEvents.restrictionsUpdated - Update flag delivered when the active restrictions change.
Implementation
Set<RouteRestrictionType> get currentRestrictions {
final OperationResult resultString = objectMethod(
pointerId,
'NavigationInstruction',
'getCurrentRestrictions',
);
final int mask = resultString['result'];
final Set<RouteRestrictionType> result = <RouteRestrictionType>{};
for (final RouteRestrictionType value in RouteRestrictionType.values) {
if (mask & value.id != 0) {
result.add(value);
}
}
return result;
}