Routing Directions

Topics: Feature Requests
Jan 11, 2011 at 4:48 PM

Hi

Awesome app

I was wondering if it would be possible to add street directions in the routing info along with the points

for example when you get a route from google it gives you :

turn right at 1st street

turn left at north street

etc

 

 

thanks again for an awesome app

i8sy

Coordinator
Jan 11, 2011 at 5:16 PM

yes, its possible, just need add some functions to parse data from http://code.google.com/intl/en/apis/maps/documentation/directions/

Feb 5, 2011 at 10:26 AM

been searching ( im not good with C# ) and not sure where or how you retreive the routing directions from

 

Sep 19, 2011 at 2:44 PM

i8sy did you ever get anywhere with this? Looked around and can't see any examples? I am no good with C# neither

thanks

Coordinator
Sep 19, 2011 at 3:02 PM

check GoogleMapProviderBase.GetRoutePointsKml

p.s. deserialization isn't implemented, but if you can handle manual xml parsing, go ahead, and use it, i'll add direction interfaces asynchronously later some day in the near future ;}

Sep 19, 2011 at 4:06 PM

superb! thanks

Sep 19, 2011 at 4:31 PM

Hi Radioman,

Downloaded latest version and tried to compile but i am getting :-

The type or namespace cannot be found GMapRoutingProvider in Googmapprovider.cs and Openstreetmapprovider.cs?

Sep 19, 2011 at 4:40 PM

Sorry, checking hotbuild now!

Sep 19, 2011 at 4:50 PM

Nope, won't compile windows mobile dll

Coordinator
Sep 19, 2011 at 5:07 PM

try it now ;}

Sep 19, 2011 at 5:13 PM

Compiled all ok! thanks

Sep 19, 2011 at 5:59 PM

Hi Radioman,

My old code :- Singleton(Of GMaps).Instance.GetRouteBetweenPoints(r_strt, r_end, False, zm) doesn't work now because of i guess the new GMapRoutingProvider. I can't seem to find the gmaproutingprovider anywhere. Can you tell me how to get my old code working again? Thanks

Coordinator
Sep 19, 2011 at 6:07 PM

check the demo source, this function is moved to GoogleMap provider

Sep 19, 2011 at 6:09 PM

right, demo source. will do

Sep 19, 2011 at 6:47 PM

Hi Radioman, I got the routing working thanks but GoogleMapProviderBase does not contain GetRoutePointskml? I am using the mobile solution. There is no demo code for using it.

Thanks

Coordinator
Sep 19, 2011 at 8:04 PM

it's incomplete, therefore private, GoogleMapProviderBase contains it ;}

Coordinator
Sep 20, 2011 at 2:51 PM

check the sound, i've finnaly managed to implement directions provider for google!

Sep 20, 2011 at 8:23 PM
Edited Sep 20, 2011 at 9:29 PM

Hi Radioman,

Someone's been busy :-) When you get a chance could you give a quick example of using the Gdirections, GDirectionStep? I found gdirections in the console app but doesn't help.

Forget the above Radioman, your a genius :-)

Thanks

Coordinator
Sep 20, 2011 at 9:21 PM

..well you just call direction function and get the results, thats it ;} ..i'll add some functionality in demos some day

Sep 20, 2011 at 11:08 PM
Edited Sep 20, 2011 at 11:37 PM

HURRY!

Price: 39.99 USD 79.99 USD (50% off offer expires September 20, 2011)

Looking into this text to speech for pocket pc, will get back with results :-)

http://www.digitalfuturesoft.com/texttospeechproductsforpocketpccheckout.php

I ordered the wrong one :-( it's actually here for more than 39.99 USD

http://www.digitalfuturesoft.com/dfttsmobilesdk.php

Well it is pretty late, that's my excuse.

Sep 21, 2011 at 11:14 AM

The sample .net project from Digital Future has been compile and is working on my HD2. If anyone knows of a FREE tts sdk please let me know before I have to buy this one.

Sep 22, 2011 at 6:22 AM

sounds great  radioman

 

any quick clues how to get this going?

Coordinator
Sep 22, 2011 at 6:38 AM

GDirections s;
var x = GMapProviders.GoogleMap.GetDirections(out s, "Lithuania,Vilnius", "Lithuania,Kaunas", false, false, false, true);
if(x == DirectionsStatusCode.OK)
{
   Debug.WriteLine(s.Summary + ", " + s.Copyrights);
   Debug.WriteLine(s.StartAddress + " -> " + s.EndAddress);
   Debug.WriteLine(s.Distance);
   Debug.WriteLine(s.Duration);
   foreach(var step in s.Steps)
   {
     Debug.WriteLine(step);  
   }
}

->

A1/E85, Map data ©2011 Tele Atlas
Vilnius, Lithuania -> Kaunas, Lithuania
105 km
1 hour 25 mins
DRIVING | 0.2 km | 1 min | Head <b>north</b> on <b>Vilniaus gatvė</b> toward <b>Tilto gatvė</b>
DRIVING | 1.3 km | 2 mins | Turn <b>left</b> onto <b>A. Goštauto gatvė</b>
DRIVING | 3.8 km | 5 mins | Turn <b>left</b> to merge onto <b>Geležinio Vilko gatvė</b>
DRIVING | 8.5 km | 9 mins | Continue onto <b>Savanorių prospektas</b>
DRIVING | 85.8 km | 58 mins | Continue onto <b>A1/E85</b>
DRIVING | 0.5 km | 1 min | Take the exit toward <b>Senamiestis/Aleksotas</b>
DRIVING | 0.2 km | 1 min | Turn <b>left</b> onto <b>Kleboniškio gatvė</b>
DRIVING | 4.3 km | 7 mins | Continue onto <b>Jonavos gatvė</b>
DRIVING | 0.5 km | 1 min | At the roundabout, take the <b>3rd</b> exit and stay on <b>Jonavos gatvė</b>
DRIVING | 0.2 km | 1 min | Turn <b>right</b> onto <b>A. Mapu gatvė</b><div style="font-size:0.9em">Destination will be on the right</div> 

Sep 22, 2011 at 7:14 AM
radioman wrote:

GDirections s;
var x = GMapProviders.GoogleMap.GetDirections(out s, "Lithuania,Vilnius", "Lithuania,Kaunas", false, false, false, true);
if(x == DirectionsStatusCode.OK)
{
   Debug.WriteLine(s.Summary + ", " + s.Copyrights);
   Debug.WriteLine(s.StartAddress + " -> " + s.EndAddress);
   Debug.WriteLine(s.Distance);
   Debug.WriteLine(s.Duration);
   foreach(var step in s.Steps)
   {
     Debug.WriteLine(step);  
   }
}

->

A1/E85, Map data ©2011 Tele Atlas
Vilnius, Lithuania -> Kaunas, Lithuania
105 km
1 hour 25 mins
DRIVING | 0.2 km | 1 min | Head <b>north</b> on <b>Vilniaus gatvė</b> toward <b>Tilto gatvė</b>
DRIVING | 1.3 km | 2 mins | Turn <b>left</b> onto <b>A. Goštauto gatvė</b>
DRIVING | 3.8 km | 5 mins | Turn <b>left</b> to merge onto <b>Geležinio Vilko gatvė</b>
DRIVING | 8.5 km | 9 mins | Continue onto <b>Savanorių prospektas</b>
DRIVING | 85.8 km | 58 mins | Continue onto <b>A1/E85</b>
DRIVING | 0.5 km | 1 min | Take the exit toward <b>Senamiestis/Aleksotas</b>
DRIVING | 0.2 km | 1 min | Turn <b>left</b> onto <b>Kleboniškio gatvė</b>
DRIVING | 4.3 km | 7 mins | Continue onto <b>Jonavos gatvė</b>
DRIVING | 0.5 km | 1 min | At the roundabout, take the <b>3rd</b> exit and stay on <b>Jonavos gatvė</b>
DRIVING | 0.2 km | 1 min | Turn <b>right</b> onto <b>A. Mapu gatvė</b><div style="font-size:0.9em">Destination will be on the right</div> 

awesome thanks for the quick reply

Sep 22, 2011 at 8:03 PM

I translated the above into :

 

Dim s As GDirections
        Dim x As DirectionsStatusCode = GMapProviders.GoogleMap.GetDirections(s, "Lithuania,Vilnius", "Lithuania,Kaunas", False, False, False, _
         True)
        If x = DirectionsStatusCode.OK Then
            Debug.WriteLine(s.Summary + ", " + s.Copyrights)
            Debug.WriteLine(s.StartAddress + " -> " + s.EndAddress)
            Debug.WriteLine(s.Distance)
            Debug.WriteLine(s.Duration)
            For Each [step] In s.Steps
                Debug.WriteLine([step])
            Next
        End If

 

which works great

however when i change the 

"Lithuania,Vilnius""Lithuania,Kaunas"

to some gmap.net.pointlatlng it doesnt work  ( x = NOT_FOUND (1))

am i doing something wrong????

also s as GDirections is not being assigned a value?

 


Coordinator
Sep 22, 2011 at 8:07 PM

show me the code ;}

Sep 23, 2011 at 3:39 AM

    Dim start As PointLatLng
        start.Lat = -37.8401568360413
        start.Lng = 145.1953125
        Dim [end] As PointLatLng
        [end].Lat = -37.9290340623256
        [end].Lng = 145.816040039063

        Dim rp As RoutingProvider = TryCast(Form1.Mainmap.MapProvider, RoutingProvider)
        If rp Is Nothing Then
            ' use google if provider does not implement routing
            rp = GMapProviders.GoogleMap
        End If
       
        Dim s As GDirections
        Dim x As DirectionsStatusCode = GMapProviders.GoogleMap.GetDirections(s, start, [end], False, False, False, True)
        If x = DirectionsStatusCode.OK Then
            Debug.WriteLine(s.Summary + ", " + s.Copyrights)
            Debug.WriteLine(s.StartAddress + " -> " + s.EndAddress)
            Debug.WriteLine(s.Distance)
            Debug.WriteLine(s.Duration)
            For Each [step] In s.Steps
                Debug.WriteLine([step])
            Next
        End If

Coordinator
Sep 23, 2011 at 6:41 AM

fixed

Sep 23, 2011 at 7:03 AM

awesome thanks alot

Sep 28, 2011 at 3:49 PM

Hi Radioman, Instead of me changing splitting the gpsroute.Distance string is it possible to have an option for Miles instead of Kilometres and yards instead of mtr?

Coordinator
Sep 29, 2011 at 6:27 AM

set parameter metric to false, and you get miles

Oct 5, 2011 at 3:51 PM

i tried above code but the X return Error in code (8). what the objective from RP. Thanks

Oct 15, 2011 at 8:52 PM

What are your import statements?  It's telling me GDirections is not defined on the Dim statement.

Coordinator
Oct 15, 2011 at 10:02 PM

? ;}

Oct 16, 2011 at 4:50 PM

I'm using vs2010 vb and the line:

Dim s As GDirections

is giving me an error.. I went through the object browser and could not find any reference to GDirections

Coordinator
Oct 16, 2011 at 5:15 PM

use the latest version

Oct 16, 2011 at 7:19 PM

Thanks, I did and got that issue resolved.  Now I have another on this line:

Dim rp As RoutingProvider = TryCast(Form1.mymap.MapProvider, RoutingProvider)

Telling me RoutingProcider is not defined.

 

Coordinator
Oct 16, 2011 at 7:33 PM

right click -> resolve references, very hard to do, requires mastery of nanoquantum engineering ;}

Oct 16, 2011 at 7:58 PM

Not working.. Doesn't come up with resolve references when right clicking.  This is what I have in my imports statement

Imports GMap.NET.WindowsForms

Imports GMap.NET.WindowsForms.Markers

Imports GMap.NET.WindowsForms.ToolTips

Imports GMap.NET

Imports GMap.NET.MapProviders

Coordinator
Oct 16, 2011 at 8:03 PM

http://greatmaps.codeplex.com/SourceControl/changeset/view/08617bef8024#GMap.NET.Core%2fGMap.NET%2fRoutingProvider.cs

Oct 16, 2011 at 8:16 PM

Maybe i'm doing something wrong.. but when I go under object browser and look in gmap.net.core->gmap.net I don't see RoutingProvider there..

Coordinator
Oct 16, 2011 at 8:18 PM
radioman wrote:

use the latest version

;}

Oct 16, 2011 at 8:29 PM

I am.. GMap.NET Build 08617bef8024.zip

Coordinator
Oct 16, 2011 at 8:34 PM

so whats the problem? man...

Oct 16, 2011 at 8:35 PM

RoutingProvider is not showing in the latest build..

Coordinator
Oct 16, 2011 at 8:41 PM

nonsense

Oct 16, 2011 at 10:58 PM

Werid.. I had to download the source and compile it.  Once I used the built .dll files then it worked.