{"action":"created","issue":{"url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/10","labels_url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/10/comments","events_url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/10/events","html_url":"https://github.com/fiveninedigital/UnifiedMaps/issues/10","id":113809740,"number":10,"title":"Polylines still visible after removing them from collection","user":{"login":"jfversluis","id":939291,"avatar_url":"https://avatars.githubusercontent.com/u/939291?v=3","gravatar_id":"","url":"https://api.github.com/users/jfversluis","html_url":"https://github.com/jfversluis","followers_url":"https://api.github.com/users/jfversluis/followers","following_url":"https://api.github.com/users/jfversluis/following{/other_user}","gists_url":"https://api.github.com/users/jfversluis/gists{/gist_id}","starred_url":"https://api.github.com/users/jfversluis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfversluis/subscriptions","organizations_url":"https://api.github.com/users/jfversluis/orgs","repos_url":"https://api.github.com/users/jfversluis/repos","events_url":"https://api.github.com/users/jfversluis/events{/privacy}","received_events_url":"https://api.github.com/users/jfversluis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"mightea","id":3684954,"avatar_url":"https://avatars.githubusercontent.com/u/3684954?v=3","gravatar_id":"","url":"https://api.github.com/users/mightea","html_url":"https://github.com/mightea","followers_url":"https://api.github.com/users/mightea/followers","following_url":"https://api.github.com/users/mightea/following{/other_user}","gists_url":"https://api.github.com/users/mightea/gists{/gist_id}","starred_url":"https://api.github.com/users/mightea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mightea/subscriptions","organizations_url":"https://api.github.com/users/mightea/orgs","repos_url":"https://api.github.com/users/mightea/repos","events_url":"https://api.github.com/users/mightea/events{/privacy}","received_events_url":"https://api.github.com/users/mightea/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/milestones/1","html_url":"https://github.com/fiveninedigital/UnifiedMaps/milestones/Xamarin%20Forms%20Maps%20compatibility","labels_url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/milestones/1/labels","id":1264517,"number":1,"title":"Xamarin Forms Maps compatibility","description":"The initial release of the UnifiedMaps component should provide the same feature set as Xamarin.Forms.Maps.","creator":{"login":"mightea","id":3684954,"avatar_url":"https://avatars.githubusercontent.com/u/3684954?v=3","gravatar_id":"","url":"https://api.github.com/users/mightea","html_url":"https://github.com/mightea","followers_url":"https://api.github.com/users/mightea/followers","following_url":"https://api.github.com/users/mightea/following{/other_user}","gists_url":"https://api.github.com/users/mightea/gists{/gist_id}","starred_url":"https://api.github.com/users/mightea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mightea/subscriptions","organizations_url":"https://api.github.com/users/mightea/orgs","repos_url":"https://api.github.com/users/mightea/repos","events_url":"https://api.github.com/users/mightea/events{/privacy}","received_events_url":"https://api.github.com/users/mightea/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"open","created_at":"2015-08-20T12:42:24Z","updated_at":"2015-10-28T15:00:09Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-10-28T12:29:30Z","updated_at":"2015-10-28T16:02:20Z","closed_at":"2015-10-28T15:00:09Z","body":"I have a project which uses your UnifiedMap and stumbled upon a problem with not removing the polylines after I removed them from the data bound collection.\r\n\r\nA little background; the app tracks a user while driving and draws the route from the moment they push the Start button.\r\n\r\nMy XAML looks like this;\r\n\r\n   <unifiedMaps:UnifiedMap x:Name=\"MapControl\" IsShowingUser=\"True\" MapType=\"Street\" HasZoomEnabled=\"True\" Polylines=\"{Binding Polylines}\" Pins=\"{Binding Pins}\"/>\r\n\r\nIn my ViewModel, when the GPS position has changed I do this to add to the route;\r\n\r\n   var mp = Polylines.FirstOrDefault() ?? new MapPolyline();\r\n   \r\n   mp.LineWidth = 10f;\r\n   mp.StrokeColor = Constants.Blue;\r\n   mp.Add(new fivenine.UnifiedMaps.Position(p.Latitude, p.Longitude));\r\n\r\n   Polylines.Add(mp);\r\n\r\nThis is already implemented a little confusing. Right now I keep adding locations to my single MapPolyline?\r\nIf I don't do it like this and add a new MapPolyline for each position I just get dots instead of a full line.\r\n\r\nThis goes fine. When the user starts another route, I erase the last one and start a new one. First I tried Polylines.Clear(); unfortunately I get thrown a not implemented message. With a foreach I get other exceptions stating that the enumeration might be modified, etc.\r\nSo I ended up with this;\r\n\r\n   for (var i = Polylines.Count - 1; i >= 0; i--)\r\n      Polylines.RemoveAt(i);\r\n\r\nBut when called it does't seem to do anything (visually). As seen on this screenshot:\r\n\r\n![simulator screen shot 28 oct 2015 13 28 36](https://cloud.githubusercontent.com/assets/939291/10788444/db33af4c-7d77-11e5-8942-c0c1169cc4b4.png)\r\n\r\nAm I doing something wrong or isn't it working?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/comments/151893062","html_url":"https://github.com/fiveninedigital/UnifiedMaps/issues/10#issuecomment-151893062","issue_url":"https://api.github.com/repos/fiveninedigital/UnifiedMaps/issues/10","id":151893062,"user":{"login":"jfversluis","id":939291,"avatar_url":"https://avatars.githubusercontent.com/u/939291?v=3","gravatar_id":"","url":"https://api.github.com/users/jfversluis","html_url":"https://github.com/jfversluis","followers_url":"https://api.github.com/users/jfversluis/followers","following_url":"https://api.github.com/users/jfversluis/following{/other_user}","gists_url":"https://api.github.com/users/jfversluis/gists{/gist_id}","starred_url":"https://api.github.com/users/jfversluis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfversluis/subscriptions","organizations_url":"https://api.github.com/users/jfversluis/orgs","repos_url":"https://api.github.com/users/jfversluis/repos","events_url":"https://api.github.com/users/jfversluis/events{/privacy}","received_events_url":"https://api.github.com/users/jfversluis/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T16:02:20Z","updated_at":"2015-10-28T16:02:20Z","body":"I'll check up on the `MoveToRegion`.\r\n\r\nMeanwhile I've forked (https://github.com/jfversluis/UnifiedMaps) the project and added a erase polylines button. So maybe I'm doing it wrong. But it does nothing."}}