How do I get the shape from the MapQuest Leaflet Directions Pugin

4 posts / 0 new
Last post
mxcolin
How do I get the shape from the MapQuest Leaflet Directions Pugin

I'm trying to get the shape from the MapQuest Leaflet Plugin but I can't seem to do it.

I call it like so

var dir = MQ.routing.directions().on('success', function (e) {
var route = e.route;
});

dir.route({
locations: [
start,
end
],
options: {
shapeFormat: 'raw'
}
});

However when the success event fires the resulting route variable has no shape information. I've tried every combination of option as well as calling routeShape directly afterwards but nothing returns the shape data in lat/lon. I don't want to render it to a map, I just want the Shape information data.

Please Help!!!


MQBrianCoakley
Set the generalize parameter
Set the generalize parameter and you should be good to go.

mxcolin
Perfect, thank you.

Perfect, thank you.


MQBrianCoakley
Cool. You're welcome.
Cool. You're welcome.