// prefetch private void button11_Click(object sender, EventArgs e) { RectLatLng area = MainMap.SelectedArea; if (!area.IsEmpty) { for (int i = MainMap.Zoom; i <= MainMap.MaxZoom; i++) { List <GMap.NET.Point> x = MainMap.Projection.GetAreaTileList(area, i, 0); DialogResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ? Total => " + x.Count, "GMap.NET", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.ShowCompleteMessage = true; obj.Start(x, i, MainMap.MapType, 100); } else if (res == DialogResult.No) { continue; } else if (res == DialogResult.Cancel) { break; } x.Clear(); } } else { MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
// prefetch private void button3_Click(object sender, RoutedEventArgs e) { RectLatLng area = MainMap.SelectedArea; if (!area.IsEmpty) { for (int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) { MessageBoxResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButton.YesNoCancel); if (res == MessageBoxResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, MainMap.MapProvider, 100); } else if (res == MessageBoxResult.No) { continue; } else if (res == MessageBoxResult.Cancel) { break; } } } else { MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
private void prefetch_btn_Click(object sender, RoutedEventArgs e) { RectLatLng rectLatLng = map_viw.SelectedArea; if (!rectLatLng.IsEmpty) { for (int i = (int)map_viw.Zoom; i <= map_viw.MaxZoom; i++) { MessageBoxResult messageBoxResult = MessageBox.Show("Ready Prefetch The Map At Zoom = " + i + " ?", "Prefetch", MessageBoxButton.YesNoCancel); if (messageBoxResult == MessageBoxResult.Yes) { TilePrefetcher tilePrefetcher = new TilePrefetcher(); tilePrefetcher.ShowCompleteMessage = true; tilePrefetcher.Start(rectLatLng, i, map_viw.MapProvider, 100); } else if (messageBoxResult == MessageBoxResult.No) { continue; } else if (messageBoxResult == MessageBoxResult.Cancel) { break; } } } else { RoverConsole.ArcEyeAiContentThreadSafe("Select The Map Area Holding ALT"); } }
private void DownloadArea() { var area = new RectLatLng(GMapControl.ViewArea.LocationMiddle, new SizeLatLng(GMapControl.ViewArea.HeightLat, GMapControl.ViewArea.WidthLng)); if (area.IsEmpty) { return; } Enumerable.Range(GMapControl.MinZoom, GMapControl.MaxZoom).ToList().ForEach(zoom => { var tilePrefetcher = new TilePrefetcher(); tilePrefetcher.Start(area, zoom, GMapControl.MapProvider, 100); }); }
public void Prefetch(RectLatLng area, int minZoon, int maxZoom) { if (!area.IsEmpty) { for (int i = minZoon; i <= maxZoom; i++) { using (TilePrefetcher obj = new TilePrefetcher()) { obj.Shuffle = mapControl.Manager.Mode != AccessMode.CacheOnly; obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, mapControl.MapProvider, mapControl.Manager.Mode == AccessMode.CacheOnly ? 0 : 100, mapControl.Manager.Mode == AccessMode.CacheOnly ? 0 : 1); } } } }
//下载区域信息 private void button1_Click(object sender, EventArgs e) { GMapOverlay overlay = new GMapOverlay("overLayDownLoadMap"); RectLatLng area = this.gMapControl1.SelectedArea; this.gMapControl1.Overlays.Add(overlay); //this.gMapControl1.Overlays.Insert(0,overlay); if (!area.IsEmpty) { for (int i = (int)this.gMapControl1.Zoom; i <= this.gMapControl1.MaxZoom; i++) { DialogResult res = MessageBox.Show("准备下载 " + i + " 级地图?", "GMap.NET", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { using (TilePrefetcher obj = new TilePrefetcher()) { obj.Overlay = overlay; // set overlay if you want to see cache progress on the map obj.Shuffle = this.gMapControl1.Manager.Mode != AccessMode.CacheOnly; obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, this.gMapControl1.MapProvider, this.gMapControl1.Manager.Mode == AccessMode.CacheOnly ? 0 : 100, this.gMapControl1.Manager.Mode == AccessMode.CacheOnly ? 0 : 1); } } else if (res == DialogResult.No) { continue; } else if (res == DialogResult.Cancel) { break; } } //overlay.Markers.Clear(); this.gMapControl1.Overlays.Remove(overlay); this.gMapControl1.SelectedArea = RectLatLng.Empty; } else { MessageBox.Show("请选中地图区域!", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button3_Click(object sender, EventArgs e) { RectLatLng area = gmap.SelectedArea; if (area.IsEmpty) { DialogResult res = MessageBox.Show("No ripp area defined, ripp displayed on screen?", "Rip", MessageBoxButtons.YesNo); if (res == DialogResult.Yes) { area = gmap.ViewArea; } } if (!area.IsEmpty) { DialogResult res = MessageBox.Show("Ready ripp at Zoom = " + (int)gmap.Zoom + " ?", "GMap.NET", MessageBoxButtons.YesNo); for (int i = 1; i <= gmap.MaxZoom; i++) { if (res == DialogResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.ShowCompleteMessage = false; obj.Start(area, i, gmap.MapProvider, 100, 0); } else if (res == DialogResult.No) { continue; } else if (res == DialogResult.Cancel) { break; } } } else { //MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnDownSelMap_Click(object sender, EventArgs e) { RectLatLng area = MainMap.SelectedArea; if (!area.IsEmpty) { for (int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) { DialogResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { using (TilePrefetcher obj = new TilePrefetcher()) { obj.Overlay = objectsLay; // set overlay if you want to see cache progress on the map obj.Shuffle = MainMap.Manager.Mode != AccessMode.CacheOnly; obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, MainMap.MapProvider, MainMap.Manager.Mode == AccessMode.CacheOnly ? 0 : 100, MainMap.Manager.Mode == AccessMode.CacheOnly ? 0 : 1); } } else if (res == DialogResult.No) { continue; } else if (res == DialogResult.Cancel) { break; } } } else { MessageBox.Show(" Alt + 右键选择地图", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button1_Click(object sender, EventArgs e) { RectLatLng area = gMapControl1.SelectedArea; if (!area.IsEmpty) { for (int i = (int)gMapControl1.Zoom; i <= gMapControl1.MaxZoom; i++) { DialogResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButtons.YesNoCancel); if (res == DialogResult.Yes) { bool mode = gMapControl1.Manager.Mode != AccessMode.CacheOnly; using (TilePrefetcher obj = new TilePrefetcher()) { obj.Shuffle = gMapControl1.Manager.Mode != AccessMode.CacheOnly; obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, gMapControl1.MapProvider, gMapControl1.Manager.Mode == AccessMode.CacheOnly ? 0 : 100, gMapControl1.Manager.Mode == AccessMode.CacheOnly ? 0 : 1); } } else if (res == DialogResult.No) { continue; } else if (res == DialogResult.Cancel) { break; } } } else { MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void CacheBtn_Click(object sender, RoutedEventArgs e) { RectLatLng area = mapView.SelectedArea; if (!area.IsEmpty) { for (int i = (int)mapView.Zoom; i <= mapView.MaxZoom; i++) { TilePrefetcher obj = new TilePrefetcher(); obj.Title = "Prefetching Tiles"; obj.Icon = this.Icon; obj.Owner = this; obj.ShowCompleteMessage = false; obj.Start(area, i, mapView.MapProvider, 100); } Close(); } else { MessageBox.Show("No Area Chosen", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
// prefetch private void btnPrefetch_Click(object sender, RoutedEventArgs e) { RectLatLng area = MainMap.SelectedArea; if (!area.IsEmpty) { for (int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) { MessageBoxResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButton.YesNoCancel); if (res == MessageBoxResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.Owner = this; obj.ShowCompleteMessage = true; obj.Start(area, i, MainMap.MapProvider, 100); } else if (res == MessageBoxResult.No) { continue; } else if (res == MessageBoxResult.Cancel) { break; } } } else { MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
void MainMap_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (startload == false) { stratload1 = false; return; } if (startload && stratload1 == false) { stratload1 = true; return; } stratload1 = false; startload = false; //throw new NotImplementedException(); MainMap.CanDragMap = true; RectLatLng area = MainMap.SelectedArea; if (!area.IsEmpty) { bool allload = false; MessageBoxResult resg = MessageBox.Show("下载缩放比例 " + (int)MainMap.Zoom + " 到 " + MainMap.MaxZoom + " 的所有切片地图?", "WLST", MessageBoxButton.YesNo); { allload = (resg == MessageBoxResult.Yes); } for (int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) { if (allload) { TilePrefetcher obj = new TilePrefetcher(); obj.Owner = Application.Current.MainWindow; obj.ShowCompleteMessage = false; obj.Start(area, i, MainMap.MapProvider, 100); continue; } MessageBoxResult res = MessageBox.Show("即将下载缩放比例为 " + i + " 的切片地图?", "WLST", MessageBoxButton.YesNoCancel); if (res == MessageBoxResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.Owner = Application.Current.MainWindow; obj.ShowCompleteMessage = true; obj.Start(area, i, MainMap.MapProvider, 100); } else if (res == MessageBoxResult.No) { continue; } else if (res == MessageBoxResult.Cancel) { break; } } } else { // MessageBox.Show("", "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
// prefetch private void button3_Click(object sender, RoutedEventArgs e) { RectLatLng area = MainMap.SelectedArea; if(!area.IsEmpty) { for(int i = (int) MainMap.Zoom; i <= MainMap.MaxZoom; i++) { var x = MainMap.Projection.GetAreaTileList(area, i, 0); MessageBoxResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ? Total => " + x.Count, "GMap.NET", MessageBoxButton.YesNoCancel); if(res == MessageBoxResult.Yes) { TilePrefetcher obj = new TilePrefetcher(); obj.ShowCompleteMessage = true; obj.Start(x, i, MainMap.MapType, 100); } else if(res == MessageBoxResult.No) { continue; } else if(res == MessageBoxResult.Cancel) { break; } x.Clear(); } } else { MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }