Reputation: 11
I'm currently using the google-maps-api-loader so I can render a google map in vue.js and place markers on it. The data are all retrieved from a json file and I had no problem with the markers but now I have to connect them using an encoded path from the json file. I have some sample pure javascript that decodes the route and I'm trying to do the same in Vue.js but it seems the geometry thing isn't working. What can i do?
I
path: google.maps.geometry.encoding.decodePath(route)
Upvotes: 0
Views: 624
Reputation: 11
First, you have to enable geometry on
Vue.use(VueGoogleMaps, { load: { key: 'xxxxxxxx', libraries: 'places,geometry', , installComponents: true});
Then on your target file, initial a google:gmapApi on computed, Finally, the path should be like this
:path="google && new google.maps.geometry.encoding.decodePath(routes)"
Upvotes: 1