setRouteRoadBlock static method
- RouteInstructionBase instruction
Sets a user-defined road block to trigger route recalculation.
Marks a road section from a RouteInstructionBase as blocked, causing active navigation to recalculate the route avoiding that zone. The block persists until resetRouteRoadBlocks is called. Useful for manually handling traffic incidents, construction, or road closures not yet reflected in map data.
Only affects active navigation sessions—road blocks set before navigation starts are ignored. Multiple road blocks can be set cumulatively; call resetRouteRoadBlocks to clear all at once.
Parameters
instruction: The RouteInstructionBase identifying the road segment to block (typically from RouteSegment.instructions).
Returns
- GemError.success if the road block was set successfully.
- Other GemError values indicate failure (e.g., invalid instruction).
See also:
- resetRouteRoadBlocks - Clears all user-defined road blocks.
- RouteInstructionBase - Base class for route turn-by-turn instructions.
- TrafficService - Service providing management of persistent road blocks.
- NavigationService - Service managing active navigation sessions.
Implementation
static GemError setRouteRoadBlock(final RouteInstructionBase instruction) {
final OperationResult result = staticMethod(
'RoutingService',
'setRouteRoadBlock',
args: instruction.pointerId,
);
return GemErrorExtension.fromCode(result['result']);
}