public void OnMapReady(MapboxMap mapboxMap)
        {
            this.mapboxMap     = mapboxMap;
            navigationMapRoute = new NavigationMapRoute(null, mapView, mapboxMap, "admin-3-4-boundaries-bg");
            Gson gson = new GsonBuilder().RegisterTypeAdapterFactory(DirectionsAdapterFactory.Create()).Create();
            var  json = loadJsonFromAsset(DIRECTIONS_RESPONSE);
            DirectionsResponse response = (DirectionsResponse)gson.FromJson(json, Class.FromType(typeof(DirectionsResponse)));

            navigationMapRoute.AddRoute(response.Routes()[0]);
            mapboxMap.SetOnMapLongClickListener(this);
            navigationMapRoute.SetOnRouteSelectionChangeListener(this);
        }
Esempio n. 2
0
        public void OnMapReady(MapboxMap p0)
        {
            var mapboxMap = p0;

            this.mapboxMap = mapboxMap;
            mapboxMap.SetStyle(styleCycle.GetStyle(), new MapboxMapSetStyleListener((style) =>
            {
                InitializeLocationComponent(mapboxMap);
                navigationMapRoute = new NavigationMapRoute(null, mapView, mapboxMap);
                mapboxMap.AddOnMapLongClickListener(this);
                Snackbar.Make(mapView, "Long press to select route", Snackbar.LengthShort).Show();
            }));
        }
Esempio n. 3
0
        public void OnMapReady(MapboxMap mapboxMap)
        {
            this.mapboxMap = mapboxMap;

            locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, null);
            locationLayerPlugin.SetLocationLayerEnabled(LocationLayerMode.Navigation);

            navigationMapRoute = new NavigationMapRoute(navigation, mapView, mapboxMap);

            mapboxMap.SetOnMapClickListener(this);
            Snackbar.Make(mapView, "Tap map to place waypoint", BaseTransientBottomBar.LengthLong).Show();

            locationEngine = new MockLocationEngine(1000, 50, true);
            mapboxMap.SetLocationSource(locationEngine);

            NewOrigin();
        }
        public void OnMapReady(MapboxMap p0)
        {
            this.mapboxMap = p0;
            this.mapboxMap.AddOnMapClickListener(this);

            mapboxMap.SetStyle(Style.MapboxStreets, new MapboxMapSetStyleListener((style) =>
            {
                LocationComponent locationComponent = mapboxMap.LocationComponent;
                locationComponent.ActivateLocationComponent(this, style);
                locationComponent.RenderMode = RenderMode.Gps;
                locationComponent.LocationComponentEnabled = false;
                navigationMapRoute = new NavigationMapRoute(navigation, mapView, mapboxMap);
                Snackbar.Make(FindViewById <ConstraintLayout>(Resource.Id.container), "Tap map to place waypoint",
                              BaseTransientBottomBar.LengthLong).Show();
                locationEngine = new ReplayRouteLocationEngine();
                NewOrigin();
            }));
        }
 private void InitMapRoute()
 {
     mapRoute = new NavigationMapRoute(mapView, mapboxMap);
     mapRoute.SetOnRouteSelectionChangeListener(this);
 }
 private void InitMapRoute()
 {
     mapRoute = new NavigationMapRoute(mapView, mapboxMap, "admin-3-4-boundaries-bg");
     mapRoute.SetOnRouteSelectionChangeListener(this);
 }