none
Multiple point routing using BingMaps v7.0 RRS feed

  • Question

  • I successfully used v6.3 before for multiple point route and direction, and I switched to v7.0 now and they use REST call to do routing, and

     

    var routeRequest = "http://dev.virtualearth.net/REST/v1/Routes?wp.0=" + start + "&wp.1=" + end + "&routePathOutput=Points&output=json&jsonp=RouteCallback&key=" + credentials;

    seems only take one set of routing location, how do I make multiple points routing like v6.3 pass a locatin array to GetDirections event?

    Thanks in advance!

     
    • Moved by Ricky_Brundritt Friday, March 9, 2012 4:48 PM (From:Bing Maps: Map Control and Web services Development)
    Wednesday, March 30, 2011 5:56 PM

Answers

  • Hello,

    You can do this in REST Web Service that you need to use with version 7.

    The API Reference here says: http://msdn.microsoft.com/en-us/library/ff701717.aspx

    waypoint.n wp.n Required.

    Specifies two or more locations that define the route and that are in sequential order. A waypoint location can be specified as a Point, a landmark, or an address. For more information about Point values, see Location and Area Types. The index (n value) for the set of waypoints in an integer starting with 0 or 1.

    The waypoint index values must be sequential and must always increment by 1. Examples: waypoint.1=47.610,-122.107 [Point] wp.1=Seattle,WA [landmark] waypoint.1=1 Microsoft Way Redmond WA [address] Incorrect set of waypoints. The following set of values is not valid because there is no waypoint.2.

    &waypoint.1=SanFrancisco&waypoint.3=Seattle

     So you can use an url like :

    var routeRequest = "http://dev.virtualearth.net/REST/v1/Routes?wp.0=" + start + "&wp.1=" + waypoint1 + "&wp.2=" + waypoint2 + "&wp.3="+ end + "&routePathOutput=Points&output=json&jsonp=RouteCallback&key=" + credentials;

     

     


    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboo
    Thursday, March 31, 2011 8:17 AM
    Moderator

All replies

  • Hello,

    You can do this in REST Web Service that you need to use with version 7.

    The API Reference here says: http://msdn.microsoft.com/en-us/library/ff701717.aspx

    waypoint.n wp.n Required.

    Specifies two or more locations that define the route and that are in sequential order. A waypoint location can be specified as a Point, a landmark, or an address. For more information about Point values, see Location and Area Types. The index (n value) for the set of waypoints in an integer starting with 0 or 1.

    The waypoint index values must be sequential and must always increment by 1. Examples: waypoint.1=47.610,-122.107 [Point] wp.1=Seattle,WA [landmark] waypoint.1=1 Microsoft Way Redmond WA [address] Incorrect set of waypoints. The following set of values is not valid because there is no waypoint.2.

    &waypoint.1=SanFrancisco&waypoint.3=Seattle

     So you can use an url like :

    var routeRequest = "http://dev.virtualearth.net/REST/v1/Routes?wp.0=" + start + "&wp.1=" + waypoint1 + "&wp.2=" + waypoint2 + "&wp.3="+ end + "&routePathOutput=Points&output=json&jsonp=RouteCallback&key=" + credentials;

     

     


    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboo
    Thursday, March 31, 2011 8:17 AM
    Moderator
  • Hello,

    How to get resolve this kind of problem? becuase the same address "
    7635 Southampton Terrace, Fort Lauderdale, FL 33321" result is given 5 suggestion address.

    Can you please assist me as soon as possible?

    URL :

    http://dev.virtualearth.net/REST/v1/Routes?wp.0=1394 SW 159th Ln, Hollywood, FL 33027&wp.1=7635 Southampton Terrace, Fort Lauderdale, FL 33321&output=xml&key=An091TxiXmv1xunLTMiJZJJp-7BDeUeOK-SWbTUKQxBJI-xjzHGZRIXY6tVpmE-Y

    Error :

     <?xml version="1.0" encoding="utf-8" ?>

    - <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
      <Copyright>Copyright © 2012 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.</Copyright>
      <BrandLogoUri>http://dev.virtualearth.net/Branding/logo_powered_by.png</BrandLogoUri>
      <StatusCode>404</StatusCode>
      <StatusDescription>Not Found</StatusDescription>
      <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
    - <ErrorDetails>
      <string>One or more locations specified in the waypoint parameter are invalid or require more information.</string>
      <string>7635 Southampton Terrace, Fort Lauderdale, FL 33321</string>
      </ErrorDetails>
      <TraceId>daf7d1d8f1ae4ea8841bb25329d6e88e|SINM001002|02.00.82.300|SINMSNVM001117, SINMSNVM001101, SINMSNVM001102</TraceId>
      <ResourceSets />

     </Response>

    Thanks
    Raja

    Friday, October 5, 2012 3:43 PM