Implement Driving Directions, Walk and Cycling using react-map-gl #1379
Unanswered
tuscanlabs
asked this question in
Q&A
Replies: 1 comment
-
You can use getMap to get the Map instance and then follow the official example. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I really like using react-map-gl. I wanted to implement driving directions. Is there a easy way to do that. Currently my code is:
<ReactMapGL {...viewport}
mapboxApiAccessToken={props.token}
mapStyle='mapbox://styles/mapbox/streets-v11'
onViewportChange={(viewport) => {setViewport(viewport);}}
>
<Button
className="marker-btn"
onClick={e => {
e.preventDefault();
setSelectedPark(park);
}}
>
<GeolocateControl
style={geolocateControlStyle}
positionOptions={{enableHighAccuracy: true}}
trackUserLocation={true}
auto
/>
Beta Was this translation helpful? Give feedback.
All reactions