Replies: 1 comment
-
I think it works as it should now. this.$refs.myMapRef.$mapPromise.then(async (mapObject) => {
const {DirectionsService, DirectionsRenderer} = await window.google.maps.importLibrary("routes");
const ds = new DirectionsService();
const dr = new DirectionsRenderer({map: mapObject, suppressMarkers: true});
ds.route({
origin: this.myCords,
destination: {lat: 59.05342382265786, lng: 10.030318594348024},
travelMode: 'DRIVING'
}).then((directionsResult) => dr.setDirections(directionsResult))
}); |
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
-
Beta Was this translation helpful? Give feedback.
All reactions