MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Virtual Earth API: Simple Multipoint Routing Example

This is a discussion on Virtual Earth API: Simple Multipoint Routing Example within the Virtual Earth Blogs forums, part of the Blogs category; One of the new features of the Virtual Earth API is multipoint routing.  Now, you can specify multiple points on ...


Go Back   MapPoint Forums > Blogs > Virtual Earth Blogs

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-04-2008
Junior Member
Yellow Belt
 
Join Date: Jan 2008
Posts: 25
Virtual Earth API: Simple Multipoint Routing Example

One of the new features of the Virtual Earth API is multipoint routing.  Now, you can specify multiple points on a route and get directions to/from them.  The new GetDirections call on the VEMap makes it easy to do this.


For example, here's a simple code sample which shows how to get driving directions from San Jose to San Francisco. The first parameter to the GetDirections call is an array of locations.  You can pass string names or latitude, longitude pairs of VELatLong objects.



var locations = new Array();
locations.push("San Jose, California");
locations.push("San Francisco, California");
map.GetDirections(locations);


For the complete code sample see:



Virtual Earth API Simple Route Example



Now, let's say on the way to San Francisco, you want to make a stop in Santa Clara and Palo Alto.  All you have to do is put those locations in the locations array in the order you want to visit them, and then pass them to GetDirections.



var locations = new Array();
locations.push("San Jose, California");
locations.push("Santa Clara, California");
locations.push("Palo Alto, California");
locations.push("San Francisco, California");
map.GetDirections(locations);


The route will then pass through the desired locations on the way to the destination.


For the complete code sample see:



Virtual Earth API Simple Multipoint Route Example



In a future post I will show more details on how to customize the route even more with the GetDirections call.



More...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/virtual-earth-api-simple-multipoint-routing-example-6967.html

Posted By For Type Date
Merging Multiple Routes - MapPoint Articles - MP2K Magazine This thread Refback 01-08-2008 03:05 PM
MapPoint Download - MP2K Magazine This thread Refback 01-05-2008 11:14 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Virtual Earth API: How to Create a Full-Screen Virtual Earth Mashup Keith Kinnan's Weblog Virtual Earth Blogs 0 01-04-2008 09:27 AM
Virtual Earth V6 - QFE VirtualEarth MSDN Blog Virtual Earth Blogs 0 12-22-2007 02:54 PM
Virtual Earth News from GEOINT 2007: Virtual Earth Appliance VE For Government Virtual Earth Blogs 0 10-24-2007 12:10 PM
Virtual Earth @ WPC VirtualEarth MSDN Blog Virtual Earth Blogs 0 09-15-2007 02:17 PM
Virtual Earth 4 Eric Frost MapPoint Web Service and Virtual Earth 0 10-31-2006 10:17 PM


All times are GMT -5. The time now is 08:42 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Val dIsere
Along with excellent skiing, Val dIsere has some breathtaking views among the 300km of piste. Book a great value ski holiday online at Holiday Hypermarket.

Turkey Weather
Check out Turkey Weather - Travel Counsellors details information on Turkey including, weather, flights and accommodation.

Cuba Holiday
A Cuba Holiday has so much to offer with numerous different cultures affecting the sights, sounds and tastes. Visit this fascinating country with dealchecker.co.uk.

Bahamas Holidays
Bahamas Holidays offer pure blue skies, soft white beaches and the holiday of a lifetime. Visit us for a great deal to the Bahamas.

Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.

Cheap Travel
Travel.co.uk has some excellent offers on cheap travel. Click here.

Holidays in Cyprus
Visit the tombs of the island kings! Visit On The Beach for information on holidays in Cyprus.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51