Even More Brilliant!

Topics: Help, Windows Forms
Jan 19, 2011 at 1:46 PM

Yes, your map control is proving to much better than I dared to expect, I bow to your genius! Thank you

I may have missed the point somewhat, and this may be a stupid question, but...

I use your GMap control in a windows Forms application, developed in VB in Visual Studio 2008.

The application is to plot astronomical observations, taken with a sextant, on board a ship at sea, to enable the user to graphically determine their position from the plotted observations

Being at sea, it is unlikely the user will have an active internet connection! What I really wanted was the functionality of your GMap contol, ie. Zooming, panning, plotting geographic coordinates, routes and markers but without necessarily having the map tiles as a background, and without bothering with any caching, should no internet connection be available!

So, is it possible to just use the Gmap control, when no internet connection is available, with a plain background colour, without even attempting to 'Connect' or retrieve map tiles? If so, how?



Jan 19, 2011 at 2:15 PM

I think this might be helpful:

mapControl.MapType = GMap.NET.MapType.None

Jan 19, 2011 at 5:28 PM

Thanks Matt, great help.

Couple more points leading on from that....

1. What is the quickest, most convenient way to determine if an internet connection is, or is not active?

2. With MapType set to None, I'd like to be able to plot on a Dark background. Whatever I set the BackColor Property of the GMap Control  to it is always displayed in the same,(on my machine) light gray color? Am I missing something here?

Rgds TS

Jan 19, 2011 at 5:37 PM

set EmptyMapBackground ;}

// set cache mode only if no internet avaible
System.Net.IPHostEntry e = System.Net.Dns.GetHostEntry("www.google.com");
MainMap.Manager.Mode = AccessMode.CacheOnly;
MessageBox.Show("No internet connection avaible, going to CacheOnly mode.", "GMap.NET - Demo.WindowsForms", MessageBoxButtons.OK, MessageBoxIcon.Warning);

Jan 19, 2011 at 6:17 PM

Good Lord! You've thought of everything! 

Many thanks

Rgds TS