public MainPageViewModel() { DidFinishRenderingCommand = new Command((obj) => { if (_IsScaleBarShown == false && CenterLocation != null) { _IsScaleBarShown = ToggleScaleBarFunc?.Invoke(true) ?? false; System.Diagnostics.Debug.WriteLine("Did toggle scale bar"); //UpdateViewPortAction?.Invoke(new Position(CenterLocation.Lat + 0.001, CenterLocation.Long + 0.001), 16, null, false, () => { // System.Diagnostics.Debug.WriteLine("Did update center location"); //}); } if (forcedRegion != null) { UpdateViewPortAction?.Invoke( new Position() { Lat = forcedRegion.Bounds.SouthWest.Lat / 2 + forcedRegion.Bounds.NorthEast.Lat / 2, Long = forcedRegion.Bounds.SouthWest.Long / 2 + forcedRegion.Bounds.NorthEast.Long / 2 }, forcedRegion.MaximumZoomLevel / 2 + forcedRegion.MinimumZoomLevel / 2, null, true, null ); forcedRegion = null; } }, (arg) => true); offlineService = DependencyService.Get <IOfflineStorageService>(); offlineService.OfflinePackProgressChanged += (sender, e) => { var progress = e.OfflinePack.Progress; float percentage = 0; if (progress.CountOfResourcesExpected > 0) { percentage = (float)progress.CountOfResourcesCompleted / progress.CountOfResourcesExpected; } System.Diagnostics.Debug.WriteLine($"Downloaded resources: {progress.CountOfResourcesCompleted} ({percentage * 100} %)"); System.Diagnostics.Debug.WriteLine($"Downloaded tiles: {progress.CountOfTilesCompleted}"); if (progress.CountOfResourcesExpected == progress.CountOfResourcesCompleted) { System.Diagnostics.Debug.WriteLine("Download completed"); Device.BeginInvokeOnMainThread(() => { UserDialogs.Instance.HideLoading(); }); } }; }
public MainPageViewModel() { DidFinishRenderingCommand = new Command((obj) => { if (_IsScaleBarShown == false && CenterLocation != null) { _IsScaleBarShown = ToggleScaleBarFunc?.Invoke(true) ?? false; System.Diagnostics.Debug.WriteLine("Did toggle scale bar"); //UpdateViewPortAction?.Invoke(new Position(CenterLocation.Lat + 0.001, CenterLocation.Long + 0.001), 16, null, false, () => { // System.Diagnostics.Debug.WriteLine("Did update center location"); //}); } }, (arg) => true); }
public MapLocationPageViewModel() { DidFinishRenderingCommand = new Command((obj) => { if (_isScaleBarShown == false && CenterLocation != null) { _isScaleBarShown = ToggleScaleBarFunc?.Invoke(true) ?? false; System.Diagnostics.Debug.WriteLine("Did toggle scale bar"); } }, (arg) => true); ZoomLevel = 5.17159761572925; }