Displays a route on the map as a colored line. Multiple shapes can reference the same route to create visual effects like outlined paths.
const route = useRoute(mapLoadResult, { origin: startLocation, destination: endLocation});<MapView map={mapLoadResult.map}> {route && ( <> <Shape route={route} strokeWidth={10} strokeColor="#E8FCFF" /> <Shape route={route} strokeWidth={5} strokeColor="#007AFF" /> </> )}</MapView> Copy
const route = useRoute(mapLoadResult, { origin: startLocation, destination: endLocation});<MapView map={mapLoadResult.map}> {route && ( <> <Shape route={route} strokeWidth={10} strokeColor="#E8FCFF" /> <Shape route={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.