{"action":"closed","issue":{"url":"https://api.github.com/repos/MicheleBertoli/react-gmaps/issues/51","repository_url":"https://api.github.com/repos/MicheleBertoli/react-gmaps","labels_url":"https://api.github.com/repos/MicheleBertoli/react-gmaps/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/MicheleBertoli/react-gmaps/issues/51/comments","events_url":"https://api.github.com/repos/MicheleBertoli/react-gmaps/issues/51/events","html_url":"https://github.com/MicheleBertoli/react-gmaps/issues/51","id":160632320,"number":51,"title":"Directions some help","user":{"login":"peterpetre","id":13170799,"avatar_url":"https://avatars.githubusercontent.com/u/13170799?v=3","gravatar_id":"","url":"https://api.github.com/users/peterpetre","html_url":"https://github.com/peterpetre","followers_url":"https://api.github.com/users/peterpetre/followers","following_url":"https://api.github.com/users/peterpetre/following{/other_user}","gists_url":"https://api.github.com/users/peterpetre/gists{/gist_id}","starred_url":"https://api.github.com/users/peterpetre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterpetre/subscriptions","organizations_url":"https://api.github.com/users/peterpetre/orgs","repos_url":"https://api.github.com/users/peterpetre/repos","events_url":"https://api.github.com/users/peterpetre/events{/privacy}","received_events_url":"https://api.github.com/users/peterpetre/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-16T10:47:36Z","updated_at":"2016-06-18T15:09:02Z","closed_at":"2016-06-18T15:09:02Z","body":"Hello there, i trying to add directions on an already drawed map to minimize api requests. The think is directionsDisplay.setMap(map); needs the map object from onMapCreated(map). There is any way to use this map object outside of it onMapCreated? Like on ComponentDidUpdate or something? Or there is any other solution? So i can play with changing direction request and to doesnt have to redraw the map.\r\n\r\n```\r\nconst start = new google.maps.LatLng(28.694004, 77.110291);\r\nconst end = new google.maps.LatLng(28.72082, 77.107241);\r\n\r\nconst directionsDisplay = new google.maps.DirectionsRenderer();\r\ndirectionsDisplay.setMap(map); // map should be already initialized.\r\n\r\nconst request = {\r\n        origin : start,\r\n        destination : end,\r\n        travelMode : google.maps.TravelMode.DRIVING\r\n };\r\n\r\nconst directionsService = new google.maps.DirectionsService(); \r\ndirectionsService.route(request, function(response, status) {\r\n        if (status == google.maps.DirectionsStatus.OK) {\r\n            directionsDisplay.setDirections(response);\r\n        }\r\n });\r\n```"}}
{"actor":{"display_login":"peterpetre"}}