{"action":"created","issue":{"url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/256","repository_url":"https://api.github.com/repos/perliedman/leaflet-routing-machine","labels_url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/256/comments","events_url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/256/events","html_url":"https://github.com/perliedman/leaflet-routing-machine/issues/256","id":156720519,"number":256,"title":"No route displayed when use more than three waypoints","user":{"login":"Pulstarter","id":4660021,"avatar_url":"https://avatars.githubusercontent.com/u/4660021?v=3","gravatar_id":"","url":"https://api.github.com/users/Pulstarter","html_url":"https://github.com/Pulstarter","followers_url":"https://api.github.com/users/Pulstarter/followers","following_url":"https://api.github.com/users/Pulstarter/following{/other_user}","gists_url":"https://api.github.com/users/Pulstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/Pulstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pulstarter/subscriptions","organizations_url":"https://api.github.com/users/Pulstarter/orgs","repos_url":"https://api.github.com/users/Pulstarter/repos","events_url":"https://api.github.com/users/Pulstarter/events{/privacy}","received_events_url":"https://api.github.com/users/Pulstarter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-25T10:53:23Z","updated_at":"2016-05-25T11:49:23Z","closed_at":null,"body":"Hi!\r\n\r\nI am developing an app based on Ionic, and I need to add a route map on it. I was be able to show the route on a map, but for no reason I get the error: **Uncaught TypeError: Cannot read property 'lat' of undefined** since a couple weeks if I try to draw a route with more than two waypoints.\r\n\r\nThe control is:\r\n\r\n     function getRoute() {\r\n        var r = L.Routing.control({\r\n\r\n          waypoints: waypoints,\r\n          router: new L.Routing.Mapbox(Config.mapBoxApiKey,\r\n            {\r\n              serviceUrl: 'https://api.tiles.mapbox.com/v4/directions/',\r\n              timeout: 30 * 1000,\r\n              profile: 'mapbox.driving'\r\n            }\r\n          ),\r\n          lineOptions: {\r\n            styles: styles\r\n          },\r\n          fitSelectedRoutes: false,\r\n          routeWhileDragging: false,\r\n          createMarker: function () {\r\n            return null;\r\n          }\r\n\r\n        });\r\n\r\n        return r;\r\n      }\r\n\r\n      var control = getRoute();\r\n\r\n      var routeLayer = L.layerGroup([control]);\r\n      self.map.addLayer(routeLayer);\r\n\r\nWith this array works fine:\r\n\r\n    var waypoints = [\r\n           new L.LatLng(42.847159, -2.672249),\r\n           new L.LatLng(42.848602, -2.672818)\r\n         ]\r\n\r\nBut with this not work:\r\n\r\n    var test = [\r\n           new L.LatLng(42.847159, -2.672249),\r\n           new L.LatLng(42.848602, -2.672818),\r\n           new L.LatLng(42.849470, -2.673123)\r\n         ] \r\n\r\nI have updated to last version of leaflet-routing-machine with no luck.\r\n\r\nLeaftleft version: 0.7.7\r\nleaflet-routing-machine version: 3.0.1\r\n\r\nAny idea to resolve this?\r\n\r\nBest regards"},"comment":{"url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/comments/221549936","html_url":"https://github.com/perliedman/leaflet-routing-machine/issues/256#issuecomment-221549936","issue_url":"https://api.github.com/repos/perliedman/leaflet-routing-machine/issues/256","id":221549936,"user":{"login":"Pulstarter","id":4660021,"avatar_url":"https://avatars.githubusercontent.com/u/4660021?v=3","gravatar_id":"","url":"https://api.github.com/users/Pulstarter","html_url":"https://github.com/Pulstarter","followers_url":"https://api.github.com/users/Pulstarter/followers","following_url":"https://api.github.com/users/Pulstarter/following{/other_user}","gists_url":"https://api.github.com/users/Pulstarter/gists{/gist_id}","starred_url":"https://api.github.com/users/Pulstarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pulstarter/subscriptions","organizations_url":"https://api.github.com/users/Pulstarter/orgs","repos_url":"https://api.github.com/users/Pulstarter/repos","events_url":"https://api.github.com/users/Pulstarter/events{/privacy}","received_events_url":"https://api.github.com/users/Pulstarter/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T11:49:23Z","updated_at":"2016-05-25T11:49:23Z","body":"Thanks for the quick response!\r\n\r\nI am using 1.0.3, so I will update to 1.0.4 and will tell.\r\n\r\nBest regards"}}
{"actor":{"display_login":"Pulstarter"}}