I am working on a program with C # and I want to calculate the route, but it returns null.
Here is my code;
PointLatLng start = new PointLatLng(38.481858, 27.089006); PointLatLng end = new PointLatLng(38.468447, 27.113793); MapRoute route = GMap.NET.MapProviders.GoogleMapProvider .Instance.GetRoute(start, end, false, false, 15); GMapRoute r = new GMapRoute(route.Points , "My route"); GMapOverlay routeOverlay = new GMapOverlay("route"); routeOverlay.Routes.Add(r); gMap.Overlays.Add(routeOverlay); double distance; distance = route.Distance; r.Stroke.Width = 2; r.Stroke.Color = Color.OrangeRed;
I do not know where I am wrong. Any help would be appreciated.
source share