VB2010 Testing / Starting

Jul 28, 2010 at 7:57 PM

Ola,

Just found this and have to congrats you with this COOL/WOW! library.

As curious as I am I downloaded everything and started a new project. Referenced GMap.NET.Core.dll, GMap.NET.WindowsForms.dll and System.Data.SQLite.dll. After that I added the GMap.NET.WindowsForms.dll to my toolbar and added the map.I found an example how to start and here's the code: 

Imports GMAP.NET
Imports GMAP.NET.CacheProviders
Imports GMAP.NET.WindowsForms
Imports GMAP.NET.WindowsForms.Markers

Public Class Form1
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        '    config(gmaps)

        With GMaps.Instance
            .UseRouteCache = True
            .UseGeocoderCache = True
            .UsePlacemarkCache = True
            .Mode = AccessMode.ServerAndCache
        End With

        '   config(map)

        With map
            .MapType = MapType.GoogleMap            
            .MaxZoom = 19
            .MinZoom = 6
            .Zoom = map.MinZoom
            .CurrentPosition = New PointLatLng(4.6961334816182, 25.2985095977783)
        End With
    End Sub
End Class

When I start the project I'm getting a blue field with the following exception: "The type initialized for 'SingletonCreator' threw an exception. We are sorry, but we don't have imagery at this zoom-level for this region."

Unfortunately there is no documentation available so I came back and have to ask. - what went wrong, and where van I find the PointLatLng (e.g. for my village)?

Thanks for the help in advance.

 

 

Coordinator
Jul 30, 2010 at 10:13 AM

hey, ..try use constructor instead of load event

Aug 26, 2010 at 7:20 AM

Ola,

I finally found that it's the 4.0 Frameworks. It works fine in the 3.5 Frameworks.

I need to add the following xml-configuration:

<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

Where do I put this? In a new/existing file? If a new file: What name?
Thanks for the help in advance.
Coordinator
Aug 26, 2010 at 7:41 AM

in the app config

Aug 26, 2010 at 9:05 AM

Thanks that worked, but still a small issue left.

When I add the control and try to rename it or save the project I get the following error: "Code generation for property 'MapType' failed.  Error was: 'The value '0' is not a valid value for the enum 'MapType'.'" When I resume it works, but the error is still weird.

Coordinator
Aug 26, 2010 at 9:38 AM

just set map type and then rename or save

Aug 26, 2010 at 9:43 AM
Edited Aug 26, 2010 at 9:52 AM

Even if I have set the maptype this issue occurs.

Was trying to compile an existing project (Frameworks 4.0) with the GMAP added:

Error    1    'NET' is not a member of 'GMap.NET.WindowsForms.GMapControl'.
Error    2    'NET' is not a member of 'GMap.NET.WindowsForms.GMapControl'.
Error    3    Value of type 'GMap.NET.Size' cannot be converted to 'System.Drawing.Size'.
Error    4    Value of type 'GMap.NET.Size' cannot be converted to 'System.Drawing.Size'.

I'm resizing a panel on the Form: panel_right.MaximumSize = New Size(348, 0) Also an error although GMAP doesn't have to do anything with it.

Thanks for the help in advance

Coordinator
Aug 26, 2010 at 9:47 AM

hm..

Aug 26, 2010 at 10:37 AM
Edited Aug 26, 2010 at 10:40 AM

I'll do some (more) testing and recoding to see if I can fix the issue. It also can be that my project got corrupted... I have older backups to test on. I'll let you know.

Aug 26, 2010 at 3:29 PM

My software was corrupted indeed... ??? Implemented in an older version. Now it works. Thanks !!!

Coordinator
Aug 26, 2010 at 4:04 PM

do you mean, current version runs ok?

Aug 26, 2010 at 4:08 PM

Yes, current version is ok. ;)

Coordinator
Aug 26, 2010 at 4:23 PM

great ;}

Aug 28, 2010 at 8:26 PM

Hi Radioman

I was using a previous version of gmaps (which is fantastic by the way) but have just swapped it out for the latest build from the latest source (greatmaps_1b1889678918). I am getting the error above. My setup is such that I have a class library (in VB.NET VS 2008 which builds with .NET 2.0) which has a user control containing the Gmap control. I then add this user control to my main app (VB.net etc...) dynamically at runtime. The wierd thing is that I have created a new app which references this class library in exactly the same way and loads the control dynamically in the same way but this works fine so I am baffled. Any ideas or advice?

Cheers

Will

Coordinator
Aug 28, 2010 at 8:37 PM

hard to tell, but maybe you forget to update all dlls?

Aug 29, 2010 at 7:25 PM

Hi Radioman

Thanks for that, I was sure you were wrong but after a bit of playing you are indeed right. What I was doing was building the Gmap solution and then taking GMap.NET.Core.dll and the GMap.NET.WindowsForms.dll and pasting them into a folder that I store all my dll's in. Then I referenced these two dll's in my main project. I noticed that in my working project the dll System.Data.SQLite.dll was pulled through to the bin\debug folder, this was not happening in my main project. Referencing the two dll's from the Gmaps build folder has solved the problem.

Thanks for your advice.

Cheers

Will

Coordinator
Aug 29, 2010 at 7:32 PM

great ;}