VB.NET Project within VS2008

Apr 29, 2009 at 7:06 PM
I want to use the GMap control from within VB.  I have included your Gmap.NET.Core  and Gmap.NET.WindowsForms  projects, along with my VB.NET project into a VS2008 solution.
I add the   System.Windows.Forms.GmapWindowsForms  control to my VB.NET form and added the following code :

        Dim mGmap As GMapNET.GMaps

        With mGmap.Instance
            .Language = "lt"
            .UseTileCache = True
            .UseRouteCache = True
            .UseGeocoderCache = True
            .UsePlacemarkCache = True
        End With

        With GMap1

            .MapType = MapType.GoogleMap
            .Zoom = 12
            .CurrentPosition = New PointLatLng(54.6961334816182, 25.2985095977783)

            .ReloadMap()

            Dim myMarker As New GMapMarkerGoogleRed(GMap1.CurrentPosition)
            .Markers.Add(myMarker)

        End With


But when the form load, i only see a black empty map.    I notice in the Windows Froms Demo,  you use MAP control interited from GMAP   , do i need to use this MAP control in my VB project rather
than the  System.Windows.Forms.GmapWindowsForms   control.  If so, then how ??? as this control is not displayed within the TOOLBOX

Please help,
Thanks
Paul.

Coordinator
Apr 29, 2009 at 7:22 PM
no need of interhitance, its just for advance; try call map.ReloadMap(); on form load event
Apr 29, 2009 at 7:28 PM
Still dos'nt work, only a blank , empty , black map.

Apr 29, 2009 at 7:31 PM
when i set the STARTUP PROJECT back to the Demo.Winforms, the demo works ok, so nothing wrong with my internet connection etc.

Apr 29, 2009 at 7:40 PM
Hmm,  i have added the above code to set map type etc onto a button. When the form loads,  nothing,  then click the button, nothing again,  but a 2nd click of the button now displays the map ok. Very strange ???
Coordinator
Apr 29, 2009 at 7:49 PM
;}
May 2, 2009 at 4:17 PM
Hello

Ok but now my question why we have have this behavior ? :-)
Then press a button 1 or 2 or 3 times is not a solution I guess.

Coordinator
May 2, 2009 at 7:44 PM
i think you miss some thing which i don't know ;/
May 19, 2009 at 10:53 PM

I am having the same problem.

I tested the demo fine. Then I created a new VB project, with a form, map, and button, then set up the GMaps.Instance variables, followed by MapType, Min/Max/Zoom, and the CurrentPosition and did a ReloadMap.

I get a black screen with a button, I click it a few times and nothing happens. But when I resize the window even just a little bit, the map loads. So it's some kind of re-painting issue?

I think the Map control itself in Visual Studio is also broken, on reloading the project the control didn't remember its size properly, and doesn't let you adjust it in the properties toolbox. I'm using VS2008.

 

May 20, 2009 at 3:33 AM

Found the problem.

After setting CurrentPosition you must execute a GoToCurrentPosition() before doing the ReloadMap(). Then it will work.

 

Jul 23, 2010 at 11:16 AM
paulmoliver wrote:


            Dim myMarker As New GMapMarkerGoogleRed(GMap1.CurrentPosition)
            .Markers.Add(myMarker)

        End With


Hello all!

I'm not found .Markers.Add ...  method in GMap control

Please help me about this

Thanks

Coordinator
Jul 23, 2010 at 11:22 AM

GMap1.Markers

Jul 23, 2010 at 11:43 AM
radioman wrote:

GMap1.Markers

Thanks!

But not have this method of Gmap control

 

Coordinator
Jul 23, 2010 at 11:51 AM

yes, we do have it ;}

Jul 23, 2010 at 12:07 PM
radioman wrote:

yes, we do have it ;}

ok !

I'm use gmap for windows forms

But i'm need to add markers

 

 

Coordinator
Jul 23, 2010 at 12:13 PM

mm, then you need to create overlay, add to it your marker, and add the overlay itself to map, check the demo for windows forms

Jul 25, 2010 at 10:22 AM
radioman wrote:

mm, then you need to create overlay, add to it your marker, and add the overlay itself to map, check the demo for windows forms

What is overlay ?

Please tell me

Coordinator
Jul 25, 2010 at 4:18 PM

overlay is overlay as well as life is life ;}

Jul 25, 2010 at 8:37 PM
Edited Jul 25, 2010 at 9:20 PM
radioman wrote:

overlay is overlay as well as life is life ;}

okey! I'm understand how create overlays

I'm look example

Thanks!