Exemple #1
0
 private void GetRoute(Point origin, Point destination)
 {
     NavigationRoute.InvokeBuilder(this)
     .Origin(origin)
     .Destination(destination)
     .AccessToken(Mapbox.Mapboxsdk.Mapbox.AccessToken)
     .Build().GetRoute(this);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 private void ResetLocationEngine(Point point)
 {
     mockLocationEngine.MoveTo(point);
     navigation.LocationEngine = mockLocationEngine;
 }