{"action":"created","issue":{"url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/5","labels_url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/5/comments","events_url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/5/events","html_url":"https://github.com/jd-alexander/Google-Directions-Android/issues/5","id":22551543,"number":5,"title":"Remove a route?","user":{"login":"exside","id":445501,"avatar_url":"https://avatars.githubusercontent.com/u/445501?v=3","gravatar_id":"","url":"https://api.github.com/users/exside","html_url":"https://github.com/exside","followers_url":"https://api.github.com/users/exside/followers","following_url":"https://api.github.com/users/exside/following{/other_user}","gists_url":"https://api.github.com/users/exside/gists{/gist_id}","starred_url":"https://api.github.com/users/exside/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exside/subscriptions","organizations_url":"https://api.github.com/users/exside/orgs","repos_url":"https://api.github.com/users/exside/repos","events_url":"https://api.github.com/users/exside/events{/privacy}","received_events_url":"https://api.github.com/users/exside/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2013-11-12T21:26:17Z","updated_at":"2015-05-14T13:29:36Z","closed_at":"2013-11-13T00:28:11Z","body":"Is it somehow possible to remove a route when another marker on a map is clicked? I have 9 markers to which the route from the current position can be asked by the user, but they just add up on top of each other (depending on the route/location). I would like to display just the route to the last clicked marker...tried to assign the Routing to a variable and then set this to null onMarkerClick but that didn't work. Any hints?"},"comment":{"url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/comments/102036814","html_url":"https://github.com/jd-alexander/Google-Directions-Android/issues/5#issuecomment-102036814","issue_url":"https://api.github.com/repos/jd-alexander/Google-Directions-Android/issues/5","id":102036814,"user":{"login":"alhinai-hamed","id":6981873,"avatar_url":"https://avatars.githubusercontent.com/u/6981873?v=3","gravatar_id":"","url":"https://api.github.com/users/alhinai-hamed","html_url":"https://github.com/alhinai-hamed","followers_url":"https://api.github.com/users/alhinai-hamed/followers","following_url":"https://api.github.com/users/alhinai-hamed/following{/other_user}","gists_url":"https://api.github.com/users/alhinai-hamed/gists{/gist_id}","starred_url":"https://api.github.com/users/alhinai-hamed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alhinai-hamed/subscriptions","organizations_url":"https://api.github.com/users/alhinai-hamed/orgs","repos_url":"https://api.github.com/users/alhinai-hamed/repos","events_url":"https://api.github.com/users/alhinai-hamed/events{/privacy}","received_events_url":"https://api.github.com/users/alhinai-hamed/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T13:29:36Z","updated_at":"2015-05-14T13:29:36Z","body":"I'm not sure if this would work.. Though try to free the routing object object before plotting routing1\nOr \nrather than declaring routing1.. Overwrite routing and the previous one should disappear\n\nHope this gives u a slight idea ..\n\nOne more thing.. There's a lot of redundancy,. U can declare start, end and routing outside the switch statement.. \nHave the switch cases involve with start and end only .. once the values are selected.. Initialize routing outside the switch and start calling routing functions. Note that This way you are only storing one route.\n\nI am not a contributor, though I got a similar project. \n\nSent from my iPhone\n\n> On 14 May 2015, at 8:43 pm, brusasu <notifications@github.com> wrote:\n> \n> Hi, thanks for this library that works perfect. I have a question and i hope you can get me into the right way.\n> \n> I draw a route from two point (fixed), and clicking in the infoview the route (polyline) will drawn into the map and it works. By the way i have 20 different marker, and i want to draw a route only when click on the infoview. I mean, if there is already a route in the map, clicking in one other infoview, this route have to be removed and the new one has to be added in the map.\n> \n> I have a Switch-case method to call each route by clicking in the infoview of the marker, this is a snippet of my code:\n> \n> switch (markerIndex){\n> case 0:\n> \n>                 start = new LatLng(22.28861858, 11.32771726);\n>                 end = new LatLng(22.48861858, 11.36779726);\n> \n>                 Routing routing = new Routing(Routing.TravelMode.WALKING);\n>                 routing.registerListener(ActivityOutdoor.this);\n>                 routing.execute(start, end);\n> \n>                 break;\n>             case 1:\n>                 start = new LatLng(21.48861858, 11.32771726);\n>                 end = new LatLng(23.48861858, 13.36779726);\n> \n>                 Routing routing1 = new Routing(Routing.TravelMode.WALKING);\n>                 routing1.registerListener(ActivityOutdoor.this);\n>                 routing1.execute(start, end);\n>                 break;\n> \n>             default:\n>                 break;\n> \n> \n>         }\n> Do you know how to remove the previous route, when click the other infoview?\n> I used map.clear(); but it will delete all the content of the map\n> Thanks in advance\n> Brus\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}