{"action":"opened","issue":{"url":"https://api.github.com/repos/xkjyeah/vue-google-maps/issues/352","repository_url":"https://api.github.com/repos/xkjyeah/vue-google-maps","labels_url":"https://api.github.com/repos/xkjyeah/vue-google-maps/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/xkjyeah/vue-google-maps/issues/352/comments","events_url":"https://api.github.com/repos/xkjyeah/vue-google-maps/issues/352/events","html_url":"https://github.com/xkjyeah/vue-google-maps/issues/352","id":302946469,"number":352,"title":"Showing the best route from a start location to multiple destination","user":{"login":"abrhambas01","id":12043306,"avatar_url":"https://avatars0.githubusercontent.com/u/12043306?v=4","gravatar_id":"","url":"https://api.github.com/users/abrhambas01","html_url":"https://github.com/abrhambas01","followers_url":"https://api.github.com/users/abrhambas01/followers","following_url":"https://api.github.com/users/abrhambas01/following{/other_user}","gists_url":"https://api.github.com/users/abrhambas01/gists{/gist_id}","starred_url":"https://api.github.com/users/abrhambas01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrhambas01/subscriptions","organizations_url":"https://api.github.com/users/abrhambas01/orgs","repos_url":"https://api.github.com/users/abrhambas01/repos","events_url":"https://api.github.com/users/abrhambas01/events{/privacy}","received_events_url":"https://api.github.com/users/abrhambas01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-07T02:54:16Z","updated_at":"2018-03-07T02:54:16Z","closed_at":null,"author_association":"NONE","body":"I can't see the best route.\r\n\r\nso when I type  on this : \t\t\r\n```\r\n<div class=\"form-inputs p-10\" v-if=\"!locationFound\">\r\n\t\t\t<h4>Where do you want to start..</h4>\r\n\t\t\t<div class=\"input-field\">\r\n\t\t\t\t<!-- <input id=\"company\" type=\"text\"> -->\r\n\t\t\t\t<gmap-autocomplete @place_changed=\"setPlace\"></gmap-autocomplete>\r\n\t\t\t</div>\r\n\r\n</div>\r\n\r\n```\r\n\r\nIt would update my startLocation \r\n\r\n\r\nAnd when I click on this : \r\n\t\t\t`<button class=\"waves-effect waves-light btn-large primary-color\" @click=\"showRoute\">START FROM HERE</button>`\r\n\r\nThe data in my markers table below would then be used for calculating the route\r\n\r\n```\r\nmarkers: [\r\n\t\t\t{\r\n\t\t\t\tposition: {\r\n\t\t\t\t\tfull_name: 'Erich  Kunze',\r\n\t\t\t\t\tlat: 10.31,\r\n\t\t\t\t\tlng: 123.89\r\n\t\t\t\t}\r\n\t\t\t}, \r\n\t\t\t{\t\r\n\t\t\t\tposition: {\r\n\t\t\t\t\tfull_name: 'Delmer Olson',\r\n\t\t\t\t\tlat: 10.32,\r\n\t\t\t\t\tlng: 123.89\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t],\r\n```\r\n\r\n\r\n\tshowRoute(){\r\n\r\n\t\t\tthis.directionsService = new google.maps.DirectionsService();\r\n\r\n\t\t\tthis.directionsDisplay = new google.maps.DirectionsRenderer();\r\n\r\n\t\t\tvar vm = this \r\n\r\n\t\t\tvar directionRenderers = [];    // array for keeping track of renderers\r\n\r\n\t\t\tfor (var i=0; i < directionRenderers.length; i++) {\r\n\t\t\t\tdirectionRenderers[i].setMap(this.$refs.map.$mapObject);\r\n\t\t\t}\r\n\r\n\t\t\tdirectionRenderers = [];\r\n\t\t\t    // create a request for each destination\r\n\t\t\t    for (i = 0; i < this.markers.length; i++) {    // guess destinations are in lieux...\r\n\t\t\t    \tvar dest = this.markers[i].position[1] +','+ this.markers[i].position[2];\r\n\t\t\t    \tvar request = {\r\n\t\t\t            origin: this.startLocation,     // assume origin is an instance of google.maps.LatLng\r\n\t\t\t            destination: dest,\r\n\t\t\t            travelMode: google.maps.DirectionsTravelMode.DRIVING\r\n\t\t\t        };\r\n\t\t\t        vm.directionsService.route(request, function(response, status){                    \r\n\t\t\t        \tif(status == google.maps.DirectionsStatus.OK){\r\n\t\t\t                // create a new DirectionsRenderer for this route\r\n\t\t\t                var dirRenderer = vm.directionsDisplay.setDirections(this.$refs.map.$mapObject)\r\n\t\t\t                dirRenderer.setDirections(response);\r\n\t\t\t                directionRenderers.push(dirRenderer);   // track the renderers\r\n\t\t\t            }\r\n\t\t\t        });\r\n\t\t\t    }\r\n\t\t\t}\r\n\r\n\r\n"}}
{"actor":{"display_login":"abrhambas01"}}