GMap in VB.Net

Mar 22, 2010 at 2:59 AM

Hi Radioman.  Sorry to be an idiot but Im really struggling to translate from C# into VB.  I'm not trying to do anything really difficult, just get the basics.  Do you have any links to some examples or demos that I can start off with.  Would really be appreciated.  Thanks


Mar 22, 2010 at 7:34 AM

what exactly do you try to do? you can look in demos source with reflector and set language to VB

Mar 22, 2010 at 11:20 AM



maybe i can be of any help. I have almost complete program now and sharing parts of it (or some hints) is no problem.

Just let me know if i can be of any help.



Mar 22, 2010 at 12:21 PM

i encourage to create fork with added vb demo inside solution, then anyone can benefit

Mar 23, 2010 at 9:09 AM

Thanks so much Heru.  Really appreciate it - I've never used c# so you can imagine, I'm pulling my hair out trying to convert it.

Can we do as radioman suggests and create a fork?

Thanks again


Mar 23, 2010 at 9:29 AM

TeflonTed, Radioman,

I don't know if i am the right person to create and maintain a fork. I do not program in OOP style.

I still program with procedures. So if that is no problem than i can help. Otherwise......sorry.


Let me know,




Mar 23, 2010 at 10:43 AM

Heru at this stage anything would help.  Is there some way we could converse offline if a fork is not acceptable?  I'm not sure how to proceed from here

Thanks again for taking the time



Mar 23, 2010 at 11:21 AM



What do you have so far? Or just nothing?



Mar 23, 2010 at 3:35 PM
Edited Mar 23, 2010 at 7:01 PM

Hi Heru

I have VS2005 .net2.  Added references to GMAP.Net.Core, Gmap.Net.Windowsforms, GMap.Net.WindowsPresentation.    Added the control to the Toolbox.

Imports  GMAP

 Imports System.Globalization

 Imports System.Windows.Forms.PaintEventArgs 

Imports System.ComponentModel

Imports System.Diagnostics

 Created form, added control, works fine.  Am able to Zoom in and out.  Change Map providors, change server/local cache and import and export cache.

So far so good.  But according to the examples, I should be able to expose OnCurrentPositionChanged, , mouse movements, rendering etc and I cant seem to get to them.

Im also having problems converting gmap values to strings etc

Does this make any sense ?




Many Thanks 


Mar 23, 2010 at 6:22 PM


Mar 24, 2010 at 12:23 AM

"Im also having problems converting gmap values to strings etc". Do you mean the map type enum?

Mar 25, 2010 at 1:38 PM

No, I had that problem but wimped out with "if dropdownboxvalue = "Bing.." then gmapcontrol.mapstyle = ... etc  Not elegant but it worked.

I was hoping that Heru could explain how he got to those that I described above though cos I cant




Mar 25, 2010 at 1:52 PM
Edited Mar 25, 2010 at 1:55 PM

this.comboBoxMapType.DataSource = Enum.GetValues(typeof(MapType));

this.comboBoxMapType.SelectedItem = this.MainMap.MapType;


Me.comboBoxMapType.DataSource = Enum.GetValues(GetType(MapType))

Me.comboBoxMapType.SelectedItem = Me.MainMap.MapType



this.MainMap.OnCurrentPositionChanged += new CurrentPositionChanged(this.MainMap_OnCurrentPositionChanged);


AddHandler Me.MainMap.OnCurrentPositionChanged, New CurrentPositionChanged(AddressOf Me.MainMap_OnCurrentPositionChanged)

Private Sub MainMap_OnCurrentPositionChanged(ByVal point As PointLatLng) = point
End Sub


private void comboBoxMapType_DropDownClosed(object sender, EventArgs e)
    this.MainMap.MapType = (MapType) this.comboBoxMapType.SelectedValue;


Private Sub comboBoxMapType_DropDownClosed(ByVal sender As Object, ByVal e As EventArgs)
    Me.MainMap.MapType = DirectCast(Me.comboBoxMapType.SelectedValue, MapType)
End Sub
Mar 26, 2010 at 7:52 PM

Many thanks for trying to help radioman, appreciated.  Currently working through your suggestions.