void FrmMapFrm_FormClosing(object sender, FormClosingEventArgs e) { if (ts != null) { ts.Dispose(); ts = null; } }
void FrmMapFrm_FormClosing(object sender, FormClosingEventArgs e) { if (ts != null) { ts.Dispose(); ts = null; } }
private void button2_Click(object sender, EventArgs e) { mapBox1.Map.BackgroundLayer.Clear(); if (m_ts != null) m_ts.Dispose(); m_ts = new BruTile.GoogleMaps.GoogleV3TileSource((BruTile.GoogleMaps.GoogleV3TileSource.MapTypeId)(m_nextMap++ % 4)); var tl = new SharpMap.Layers.TileAsyncLayer(m_ts, "Google"); mapBox1.Map.BackgroundLayer.Add(tl); mapBox1.Refresh(); }
public FrmMapFrm() { ts = new BruTile.GoogleMaps.GoogleV3TileSource(); InitializeComponent(); SharpMap.Layers.TileLayer tl = new SharpMap.Layers.TileLayer(ts, "Google"); mapBox1.Map.Layers.Add(tl); mapBox1.Map.ZoomToBox(new GeoAPI.Geometries.Envelope(-1500000, 4250000, 4500000, 12500000)); mapBox1.EnableShiftButtonDragRectangleZoom = true; mapBox1.PanOnClick = false; mapBox1.SetToolsNoneWhileRedrawing = false; mapBox1.Refresh(); this.FormClosing += new FormClosingEventHandler(FrmMapFrm_FormClosing); }
public FrmMapFrm() { ts = new BruTile.GoogleMaps.GoogleV3TileSource(); InitializeComponent(); SharpMap.Layers.TileLayer tl = new SharpMap.Layers.TileLayer(ts, "Google"); mapBox1.Map.Layers.Add(tl); mapBox1.Map.ZoomToBox(new GeoAPI.Geometries.Envelope(-1500000, 4250000, 4500000, 12500000)); mapBox1.EnableShiftButtonDragRectangleZoom = true; mapBox1.PanOnClick = false; mapBox1.SetToolsNoneWhileRedrawing = false; mapBox1.Refresh(); this.FormClosing += new FormClosingEventHandler(FrmMapFrm_FormClosing); }
private void button2_Click(object sender, EventArgs e) { mapBox1.Map.BackgroundLayer.Clear(); if (m_ts != null) { m_ts.Dispose(); } m_ts = new BruTile.GoogleMaps.GoogleV3TileSource((BruTile.GoogleMaps.GoogleV3TileSource.MapTypeId)(m_nextMap++ % 4)); var tl = new SharpMap.Layers.TileAsyncLayer(m_ts, "Google"); mapBox1.Map.BackgroundLayer.Add(tl); mapBox1.Refresh(); }
public Form1() { ts = new BruTile.GoogleMaps.GoogleV3TileSource(BruTile.GoogleMaps.GoogleV3TileSource.MapTypeId.ROADMAP); InitializeComponent(); SharpMap.Layers.TileAsyncLayer tl = new SharpMap.Layers.TileAsyncLayer(ts, "Google"); tl.OnlyRedrawWhenComplete = true; mapBox1.Map.BackgroundLayer.Add(tl); mapBox1.Map.ZoomToBox(new GeoAPI.Geometries.Envelope(-1500000, 4250000, 4500000, 12500000)); mapBox1.EnableShiftButtonDragRectangleZoom = true; mapBox1.PanOnClick = false; mapBox1.SetToolsNoneWhileRedrawing = false; mapBox1.Refresh(); }
public Form1() { ServicePointManager.DefaultConnectionLimit = 20; m_ts = new BruTile.GoogleMaps.GoogleV3TileSource(BruTile.GoogleMaps.GoogleV3TileSource.MapTypeId.ROADMAP); InitializeComponent(); var tl = new SharpMap.Layers.TileAsyncLayer(m_ts, "Google"); tl.OnlyRedrawWhenComplete = true; mapBox1.Map.BackgroundLayer.Add(tl); mapBox1.Map.ZoomToBox(new GeoAPI.Geometries.Envelope(-1500000, 4250000, 4500000, 12500000)); mapBox1.EnableShiftButtonDragRectangleZoom = true; mapBox1.PanOnClick = false; mapBox1.SetToolsNoneWhileRedrawing = false; mapBox1.Refresh(); }
private void button2_Click(object sender, EventArgs e) { mapBox1.Map.BackgroundLayer.Clear(); if (ts != null) ts.Dispose(); ts = new BruTile.GoogleMaps.GoogleV3TileSource((BruTile.GoogleMaps.GoogleV3TileSource.MapTypeId)(nextMap++ % 4)); SharpMap.Layers.TileAsyncLayer tl = new SharpMap.Layers.TileAsyncLayer(ts, "Google"); mapBox1.Map.BackgroundLayer.Add(tl); mapBox1.Refresh(); //for (int i = 0; i < 10; i++) { // FrmMapFrm frm = new FrmMapFrm(); // frm.Show(); //while (!frm.Visible) //{ // Thread.Sleep(100); //} //frm.Close(); //frm.Dispose(); } }