Can't get back "shape"

6 posts / 0 new
Last post
Can't get back "shape"

For some reason, mapquest won't give me the direction shape. 


  1. Request URL:

The response preview is:

  1. info: {copyright: {text: "© 2015 MapQuest, Inc.", imageUrl: "",…},…}
  2. route: {hasTollRoad: true, computedWaypoints: [], fuelUsed: 30.01, hasUnpaved: false, hasHighway: true,…}
    1. boundingBox: {ul: {lng: -100.534744, lat: 39.828163}, lr: {lng: -89.861976, lat: 38.30516}}
    2. computedWaypoints: []
    3. distance: 689.4151
    4. formattedTime: "10:39:30"
    5. fuelUsed: 30.01
    6. hasCountryCross: false
    7. hasFerry: false
    8. hasHighway: true
    9. hasSeasonalClosure: false
    10. hasTollRoad: true
    11. hasUnpaved: false
    12. legs: [{hasTollRoad: false, index: 0, roadGradeStrategy: [[]], hasHighway: true, hasUnpaved: false,…},…]
    13. locationSequence: [0, 1, 2, 3, 4]
    14. locations: [,…]
    15. options: {mustAvoidLinkIds: [], drivingStyle: 2, countryBoundaryDisplay: true, generalize: -1,…}
    16. realTime: -1
    17. routeError: {message: "", errorCode: -400}
    18. sessionId: "56223028-01a3-0007-02b7-4f6c-00163ec01eda"
    19. time: 38370

 What am I doing wrong?

Two things: First, when using
Two things: First, when using json input, make sure to include the options in the json, not the kvp. Second, make sure to set the route shape and generalization parameters. I added this to your json and got the route shape.   ,options:{shapeFormat:raw,generalize:1}

That worked great, except

That worked great, except that dragging no longer works.  You can drag the markers, but the route doesn't update and neither does the direction print.

Is there a url where we can
Is there a url where we can see this happening?


I can't expose my local server at the moment, but here is a demo.


Ok, I didn't realize the you
Ok, I didn't realize the you were using the Leaflet toolkit and drag routing. Changing the shape format breaks the drag route.    The route plug in makes 2 requests: one for the route and another for the route shape. Use the route shape response to get the shape points.