Problems with WindowsPresentation in VB.net

Dec 29, 2009 at 6:37 PM

1) No tiles are downloaded if the accessmode is set to ServerAndCache (Blue tiles show up saying that the image was not found)... it will only work if ServerOnly is used...

        GMaps.Instance.UseRouteCache = True
        GMaps.Instance.UseGeocoderCache = True
        GMaps.Instance.UsePlacemarkCache = True
        GMaps.Instance.UseGeocoderCache = True
        GMaps.Instance.Mode = AccessMode.ServerOnly

        MainMap.MapType = MapType.BingHybrid
        MainMap.MinZoom = 3
        MainMap.MaxZoom = 19
        MainMap.Zoom = MainMap.MinZoom
        MainMap.MouseWheelZoomType = MouseWheelZoomType.MousePosition
        MainMap.CurrentPosition = New PointLatLng(54.6961334816182, 25.2985095977783)

 

2) Whenever I try to save the ImageSource, i get a grey bar on the bottom of my exported image.

        Dim StoreImage As System.Windows.Media.ImageSource
        Dim Encoder As New PngBitmapEncoder
        Dim st As System.IO.Stream = System.IO.File.OpenWrite("C:\Test.png")

StoreImage = MainMap.ToImageSource() Encoder.Frames.Add(BitmapFrame.Create(StoreImage)) Encoder.Save(st) st.Close()

 

It works fine in the C# example provided with the source code.

 

Everything else seems to be working fine.

Any feedback would be great.

Dec 30, 2009 at 1:59 PM

Fixed #2 somehow by rearranging windows.

 

#1 still does not work in VB.net in WindowsPresentation.... it works fine in Windows Forms...

Any help would be great!

Dec 31, 2009 at 2:13 PM

Hello iifuzz,

 

2) I have tried "your" code in VB/WPF and its fine. Tried it on several zoomlevels.

What is the graybar saying???

 

Hein

 

 

Dec 31, 2009 at 2:17 PM

hi Heru,

thanks for the reply...

 

i think i found the cause... i just dont know how to fix it.

 

this error is being spammed when i have ServerAndCache enabled..

 CLR:(C:\Documents and Settings\mterneus\my documents\visual studio 2010\Projects\Test\Test\bin\Debug\System.Data.SQLite.dll) ERR: Rejecting IJW module built against v2.0.50727 because it could be loaded into another runtime in this process.
First-chance exception at 0x7c812afb in Test.exe: Microsoft C++ exception: EEMessageException at memory location 0x04c2d70c..
First-chance exception at 0x7c812afb in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812afb in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812afb in Test.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..

Dec 31, 2009 at 2:24 PM
Edited Dec 31, 2009 at 2:27 PM

There is a fix here. :)

http://sqlite.phxsoftware.com/forums/t/2040.aspx