private void GetRoute(Point origin, Point destination) { NavigationRoute.InvokeBuilder(this) .Origin(origin) .Destination(destination) .AccessToken(Mapbox.Mapboxsdk.Mapbox.AccessToken) .Build().GetRoute(this); }
public void UserOffRoute(Location p0) { origin = Point.FromLngLat(lastLocation.Longitude, lastLocation.Latitude); GetRoute(origin, destination); Snackbar.Make(contentLayout, "User Off Route", Snackbar.LengthShort).Show(); var marker = new MarkerOptions(); marker.SetPosition(new LatLng(p0.Latitude, p0.Longitude)); mapboxMap.AddMarker(marker); }
public bool OnMapClick(LatLng p0) { if (!running || mapboxMap == null || lastLocation == null) { return(false); } var marker = new MarkerOptions(); marker.SetPosition(p0); mapboxMap.AddMarker(marker); mapboxMap.RemoveOnMapClickListener(this); destination = Point.FromLngLat(p0.Longitude, p0.Latitude); ResetLocationEngine(destination); tracking = false; return(false); }
private void ResetLocationEngine(Point point) { mockLocationEngine.MoveTo(point); navigation.LocationEngine = mockLocationEngine; }