Asked by:
driving directions

Question
-
User1212068408 posted
Hello Guys,
Anyone knows how I can implement driving directions? Google Maps API doesnt work on Pocket IE.
Any help would greatly appreciated.
Thanks
crawler
Wednesday, April 9, 2008 6:35 PM
All replies
-
User2020834294 posted
Hi,
Try Virtual Earth from live.com
More info on http://dev.live.com
Works really well :)
Wednesday, April 9, 2008 10:08 PM -
User1212068408 posted
Hi Amensi,
Thanks for the reply!
Quick question, do you know if it would work in pocket IE?
Regards,
Jason
Wednesday, April 9, 2008 10:12 PM -
User2020834294 posted
According to this: http://blogs.msdn.com/iemobile/archive/2005/11/15/493200.aspx
I don't see why not.
Wednesday, April 9, 2008 10:21 PM -
User1212068408 posted
damn, Virtual Earth also uses MapPoint for driving directions services. MapPoint is not free [:S]
Wednesday, April 9, 2008 10:29 PM -
User2020834294 posted
Hi,
Are you sure about that?
http://msdn.microsoft.com/en-us/library/bb877838.aspx
this is the code to use directions and virtual earth SDK. you don't need to use MapPoint's API or WebService:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script> <script type="text/javascript"> var map = null; function GetMap() { map = new VEMap('myMap'); map.LoadMap(); var options = new VERouteOptions(); options.RouteCallback = onGotRoute; map.GetDirections(["Microsoft", "Everett WA", "Bellingham WA"], options); } function onGotRoute(route) { // Unroll route var legs = route.RouteLegs; var turns = "Total distance: " + route.Distance.toFixed(1) + " mi\n"; var numTurns = 0; var leg = null; // Get intermediate legs for(var i = 0; i < legs.length; i++) { // Get this leg so we don't have to derefernce multiple times leg = legs[i]; // Leg is a VERouteLeg object // Unroll each intermediate leg var turn = null; // The itinerary leg for(var j = 0; j < leg.Itinerary.Items.length; j ++) { turn = leg.Itinerary.Items[j]; // turn is a VERouteItineraryItem object numTurns++; turns += numTurns + ".\t" + turn.Text + " (" + turn.Distance.toFixed(1) + " mi)\n"; } } alert(turns); } </script> </head> <body onload="GetMap();"> <div id='myMap' style="; width:400px; height:400px;"></div> </body> </html>
Thursday, April 10, 2008 4:18 PM -
User1212068408 posted
Thanks Amensi,
I tried similar function using google map api and its not working on mobile browser(pocket IE). I was looking into MapPoint's webservices so I can do the processing in the back-end as oppose to doing it on front-end using javascript (like code above). Nonetheless, I am going to try your code and see if it would work on the pocket IE.
I really appreciate your input on this one.
Thanks and best regards,
crawler
Thursday, April 10, 2008 4:50 PM -
User1212068408 posted
Ok, I tried method above and it doesnt work on pocket IE. I wonder if there is an XML Web Services version of that (not MapPoint). [:(]
Thursday, April 10, 2008 5:31 PM -
User2020834294 posted
I don't know if this would help : http://www.viavirtualearth.com/vve/Gallery/VEMobile.ashx
Thursday, April 10, 2008 5:51 PM -
User1212068408 posted
I don't know if this would help : http://www.viavirtualearth.com/vve/Gallery/VEMobile.ashx
hmm looks like a windows application. what I need is a browser based solution. But I'll have a read, maybe theres something in there that can help me. Thanks man!
Thursday, April 10, 2008 6:05 PM