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