Route call has implicit opt-in of traffic conditions

2 posts / 0 new
Last post
jpero
Route call has implicit opt-in of traffic conditions

We have been going over our monthly MapQuest transaction counts for a few months now, incurring overage charges due to errant behaviour of the MQ plugin for Leaflet (i.e. https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-routing.js)

I have tried varying configurations of options parameters, but I can still see the traffic transaction count increasing on my API key.

Stepping through the route() function, I can see the following code:

if (MQ.mapConfig.getConfig("configNumber") != I) { // I = 4
K.options.conditionsAheadDistance = 200;
K.options.generalize = 0
}

Can anybody explain the purpose of this code block? What does the 'configNumber' represent?

There is zero mention of the 'configNumber' anywhere in the MapQuest docs.

Using the following undocumented function, when we explicitly set the configNumber to a value of 4, the route() method does not append the conditionsAheadDistance property, which results in NO traffic transaction hit!

MQ.mapConfig.setConfig("configNumber", 4);

See the following JSFiddle for an example: https://jsfiddle.net/s3pmqcb2/2/

This kind of implicit behaviour is really disappointing. It is not the first time we have encountered non-directional transaction hits being tacked on to our Directions API calls (i.e. doReverseGeocode defaults to true, when not explicitly set - but at least this is documented)


MQBrianCoakley
I don't believe the traffic
I don't believe the traffic can be turned off in the old Leaflet plugins. But it can be turned off in MapQuest.js.