コード例 #1
0
        private async void ContentPage_AppearingAsync(object sender, EventArgs e)
        {
            var customMap = this.FindByName <CustomMap>("MapRouteOverview");

            /*var points = await vm.GetPointsForOverviewRouteAsync();
             * customMap.Points = points.Select(x => new PointForMap()
             * {
             *  Latitude = x.Latitude, Longitude = x.Longitude, PathToPicture = x.ImagePreviewPathForList, Name = x.Name, Description = x.Description
             * }).ToList();*/
            TrackFileManager trackFileManager = new TrackFileManager();
            var track = trackFileManager.GetTrackByRoute(_routeId);

            customMap.Points = track.Select(t => new PointForMap()
            {
                Latitude  = t.Item1 ?? 0.0,
                Longitude = t.Item2 ?? 0.0
            }).ToList();
            Pin           pin           = new Pin();
            CustomMapView customMapView = new CustomMapView(customMap, 15);

            if (customMap.Points.Any())
            {
                await centerMap(customMapView, customMap.Points.First().Latitude, customMap.Points.First().Longitude);
            }
        }
コード例 #2
0
 public RouteCarouselRootViewModel(string routeId)
 {
     BackNavigationCommand        = new Command(backNavigationCommand);
     CardsItemAppearedCommand     = new Command(cardsItemAppearedCommand);
     ShowOtherPhotoCommand        = new Command(showOtherPhotoCommand);
     SwipeDescriptionRightCommand = new Command(swipeDescriptionRightCommand);
     SwipeDescriptionLeftCommand  = new Command(swipeDescriptionLeftCommand);
     ViewPhotoCommand             = new Command(viewPhotoCommand);
     ChangeImageAspectCommand     = new Command(changeImageAspectCommand);
     _trackFileManager            = new TrackFileManager();
     _vRoute = new ViewRoute(routeId);
 }
コード例 #3
0
 public MapRouteOverviewV2ViewModel(string routeId)
 {
     HidePoiDialogCommand        = new Command(hidePoiDialogCommand);
     OpenRoutePointDialogCommand = new Command(openRoutePointDialogCommand);
     SetNewLocationCommand       = new Command(setNewLocationCommand);
     BackNavigationCommand       = new Command(backNavigationCommandAsync);
     CancelSetLocationCommand    = new Command(cancelSetLocationCommand);
     _routeId              = routeId;
     _trackFileManager     = new TrackFileManager();
     _routePointManager    = new RoutePointManager();
     RoutePointFrameWidth  = Convert.ToInt32(DeviceSize.FullScreenWidth * 0.9);
     RoutePointFrameHeight = Convert.ToInt32(DeviceSize.FullScreenHeight * 0.7);
 }