NathanAP / vue-google-maps-community-fork

The community fork for Vue Google Maps library
https://vue-google-maps-community-fork.netlify.app
MIT License
107 stars 32 forks source link

Custom Components / Support for Directions? #66

Open ShaneOH opened 1 year ago

ShaneOH commented 1 year ago

Hello, is it possible to make DirectionsService and DirectionsRenderer work with this library? It seems like the Vue 2 version had support for adding custom components.

Is similar functionality available for this? A simple example to calculate the directions between two markers on a map here would be fantastically helpful.

NathanAP commented 1 year ago

Hello! I'm so sorry for the late response ): My life had some changes lately, so I had stuff to resolve.

Anyway, I believe there is some of functionality that might not be available comparing to the very first version because Fawmi also didn't implemented it. I'll look into it :)

jeffbruchado commented 1 year ago

Just leaving a comment here to follow the discussion, because I'm migrating an application from Vue 2 to Vue 3 and I'm going to need this functionality to display directions on maps

ShaneOH commented 1 year ago

@jeffbruchado I ended up getting this working (still using the fawmi package) and it was pretty straightforward

this.directionsService = new google.maps.DirectionsService();
...
this.directionsDisplay = new google.maps.DirectionsRenderer();
this.directionsDisplay.setMap(this.$refs.map.$mapObject);

etc.

If you run into any issues you can let me know and I can try to help

faris-isa commented 4 months ago

hello. I have no idea how to insert this code. since from what I know is you didn't need to import any google variable. so how to implement this direction services