Problems with MsSQLPureImageCache

Apr 13, 2010 at 12:47 PM
Edited Apr 13, 2010 at 12:51 PM

Hi all,

(Using vb.net 2010)

I'm having problems using cache.

If I use other AccessMode than  AccessMode.ServerOnly, I get no map at all.

No I tried this:

 With GMaps.Instance
                    .UseRouteCache = True
                    .UseGeocoderCache = True
                    .UsePlacemarkCache = True
                    .Mode = AccessMode.CacheOnly
                    Dim ch As New CacheProviders.MsSQLPureImageCache                    
                    ch.ConnectionString = "Data Source=DC1;Initial Catalog=GoogleCache;Integrated Security=True"
                    .ImageCacheSecond = ch
                End With
With GMaps.Instance
    .UseRouteCache = True
    .UseGeocoderCache = True
    .UsePlacemarkCache = True
    .Mode = AccessMode.CacheOnly
    Dim ch As New CacheProviders.MsSQLPureImageCache                    
ch.ConnectionString = "Data Source=MySqlServer;Initial Catalog=GoogleCache;Integrated Security=True" .ImageCacheSecond = ch End With

This doesn't help. No maps are shown, no tables are created in database and no exceptions.

Any idea where I go wrong?

Thanks!

Mojo

 

 

 

Coordinator
Apr 13, 2010 at 1:02 PM

CacheOnly - means local cache only, if you do not have any tiles caches, you do no see them ;} Prefetch your cache or use ServerAndCache mode

Apr 13, 2010 at 1:14 PM

Hey Radioman,

I tried using ServerAndCache, nothing happen .. only a white control. As soon as I change it to ServerOnly, the map shows.

Wierd.

Thanks,
Mojo 

Coordinator
Apr 13, 2010 at 1:33 PM

whats your debug output?

Coordinator
Apr 13, 2010 at 1:34 PM

Dim ch As New CacheProviders.MsSQLPureImageCache // MS SQL  
"Data Source=MySqlServer;Initial Catalog=GoogleCache;Integrated Security=True" // My SQL ?

Apr 13, 2010 at 2:05 PM

As soon as I change it from AccessMode.ServerOnly to AccessMode.ServerAndCache nothing happens ... it's trying to fetch tiles for like 10 senconds and then it just stops. No exceptions.

Yes I'm using MS Sql Server.

Thanks for your help so far!

Mojo

Coordinator
Apr 13, 2010 at 7:05 PM

did you tried pure demos with no changes in debug mode?

Apr 14, 2010 at 6:29 AM
Edited Apr 14, 2010 at 6:30 AM

Hi,

When I try your demoes everything works fine.

I tried to create a new project (.net 4.0), made it x86 and added reference to your dlls.

This is my only code:

 

Imports GMap.NET
Imports GMap.NET.WindowsForms
Imports GMap.NET.WindowsForms.Markers

Public Class Form1

    Const connectionString As String = "Data Source=MySqlServer;Initial Catalog=GoogleCache;Integrated Security=True"
    Private WithEvents map As GMapControl

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        map = New GMapControl
        Me.Controls.Add(map)
        map.Dock = DockStyle.Fill
        map.MapType = GMap.NET.MapType.GoogleMap

        map.CanDragMap = True
        map.MaxZoom = 15
        map.MinZoom = 1

        With GMaps.Instance
            .UseRouteCache = True
            .UseGeocoderCache = True
            .UsePlacemarkCache = True
            .Mode = AccessMode.ServerAndCache
            Dim ch As New CacheProviders.MsSQLPureImageCache
            ch.ConnectionString = connectionString
            .ImageCacheSecond = ch
        End With
    End Sub

End Class

This does not work. Everything is blank except the scale in top left. No tables are created in the GoogleMaps mssql table. There's no exception thrown.

If I change to ... .Mode = AccessMode.ServerAndCache ... everything works (except for cache of course).

I'm not entire sure wich debug output you want.

:)

Thanks

Mojo


 

Coordinator
Apr 14, 2010 at 6:46 AM

there is only one output in visual studio ;} so?

Apr 14, 2010 at 7:10 AM

Oh yeah ok .. now I get what you mean. :)

Well debug output is empty:

http://img442.imageshack.us/img442/6363/gmapprintscreen.png

Mojo

Coordinator
Apr 14, 2010 at 7:35 AM

you add control on form load, and why can't you drag control on form using designer? ;}

Apr 14, 2010 at 7:48 AM

I use lots of third party controls in all my projects, so to avoid filling up the Toolbox, I some times chose to load them on startup.

Well I tried add the GMapControl to toolbox with following code:

 

Imports GMap.NET
Imports GMap.NET.WindowsForms
Imports GMap.NET.WindowsForms.Markers


Public Class Form1

    Const connectionString As String = "Data Source=DC1;Initial Catalog=GoogleCache;Integrated Security=True"


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With GMapControl1
            .MapType = GMap.NET.MapType.GoogleMap
            .CanDragMap = True
            .MaxZoom = 15
            .MinZoom = 1
            With GMaps.Instance
                .UseRouteCache = True
                .UseGeocoderCache = True
                .UsePlacemarkCache = True
                .Mode = AccessMode.ServerAndCache
                Dim ch As New CacheProviders.MsSQLPureImageCache
                ch.ConnectionString = connectionString
                .ImageCacheSecond = ch
            End With
            .ReloadMap()
        End With
    End Sub

End Class

But it still does not work.

 

Coordinator
Apr 14, 2010 at 8:02 AM

i doubt it works adding it manualy

Apr 20, 2010 at 6:13 AM

i had the same problem with VS 2010 RC and C#
i was using OpenStreetMap not google
and not using any special cache thingy

Just adding a map in OnLoad

it was because i was using .NET 4.0 when i changed to 3.5 it worked

Coordinator
Apr 20, 2010 at 7:14 AM

for .net4 check documentation

Apr 20, 2010 at 7:34 AM

Yeah - already tried the...

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

... but it still doesn't work.

Mojo

Coordinator
Apr 20, 2010 at 7:43 AM

yes it did! ;}

Apr 20, 2010 at 7:51 AM

No, I still haven't managed to make it work, so I run without cache.

:)

Apr 20, 2010 at 8:14 AM
Edited Apr 20, 2010 at 8:16 AM

No adding to app.config dosen't work for me when using .NET 4.0

morajodk have you tryed to change to .NET 3.5

and to rule out Caching

try just add a simple map without caching
and possibly use OpenStreetMap instead of Google


Edited
Sorry to quick to post
at first it didn't work, but after a clean and rebuild it worked

 

Coordinator
Apr 20, 2010 at 8:14 AM
Edited Apr 20, 2010 at 7:13 PM

yes, adding to app.config works, i've tested, and it's perfect ok

check http://greatmaps.codeplex.com/Thread/View.aspx?ThreadId=208671