MapRoute return null

Topics: WPF
Jul 20, 2011 at 9:49 AM

Hello everyone,

I'm fresh in WPF, so I have problem with MapRoute. In that code (for example):

//Map Config
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
Map.DragButton = MouseButton.Left;
Map.MapType = MapType.GoogleMap;
Map.MaxZoom = 20;
Map.MinZoom = 1;
Map.Zoom = 10;
Map.ShowCenter = false;
GMap.NET.PointLatLng p1 = new GMap.NET.PointLatLng(53.398889, 10.737076);
GMap.NET.PointLatLng p2 = new GMap.NET.PointLatLng(54.08827, 12.428176);
MapRoute route = GMaps.Instance.GetRouteBetweenPoints(p1, p2, false, (int)Map.Zoom);
And variable route always return me null. I run Demo WPF application and there everything working, so I feel a little bit confused.
I will be grateful for any help. 


Jul 20, 2011 at 9:55 AM

whats the exception?

Jul 20, 2011 at 10:19 AM
Edited Jul 20, 2011 at 10:41 AM

Thanks for fast request, I haven't any exception, just 'route' variable has null. I think, I missed something in Map config.

I upload project for server, if you have a couple times...

Jul 20, 2011 at 11:11 AM

i've fixed it,!118&group=0&sff=0

Jul 20, 2011 at 11:29 AM

Thank's for that, but when I run app I haven't map, I only have exception on map: 'The type initializer for 'SingletonCreator' threw an exception'.

When I change to Server only, everything work perfectly, but route is still null. Do you have any more idea? Or I do something wrong?

Jul 20, 2011 at 1:25 PM

nothing is wrong, i fixed it and map is loading, route is loading.

Jul 20, 2011 at 8:13 PM
Edited Jul 20, 2011 at 8:13 PM

You're right. Everything is clear.

Thank's a lot for your help.

PS. Great job with thatcontrol

Jul 21, 2011 at 7:40 AM

...release version is a bit complicated, you must drag sqlite dlls in your output folder, i recommend to try use trunk version from source control, it's quite stable and have no need of managing sqlite dlls manualy