const routeResult = useRoute(mapLoadResult, {
origin: startLocation,
destinations: [endLocation]
});
<MapView map={mapLoadResult.map}>
{routeResult.status === 'success' && (
<>
<Shape route={routeResult.route} strokeWidth={10} strokeColor="#E8FCFF" />
<Shape route={routeResult.route} strokeWidth={5} strokeColor="#007AFF" />
</>
)}
</MapView>
Displays a route on the map as a colored line. Multiple shapes can reference the same route to create visual effects like outlined paths; they are stacked in the order they appear inside the MapView, so the last one is drawn on top.