-1

Is there a way to remove or at least minimize number of traffic Transaction in MapQuest Leaflet Maps.

if (dir == null) {
        dir = MQ.routing.directions()
           .on('success', function (data) {
               routeSummary(data);

                });

         dir.route({
                 locations: locations,   // is a var of multiple locations (Lat/lon) 
                    options: {
                        avoids: [],
                        disallows: [],
                        destinationManeuverDisplay: false,
                        doReverseGeocode: false,
                        manMaps: false,
                        sideOfStreetDisplay: false
                    }
                });
            }

Where routeSummary is Defined as

function routeSummary(data) {
    if (data && data.route && data.route.distance) 
     {
                var distance = data.route.distance;
                var time = data.route.formattedTime;
     }      
 }
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300

2 Answers2

0

This doesn't look like it should count any traffic transactions. Is there a url where we can see the application working with the key in question?

MQBrian
  • 452
  • 1
  • 3
  • 7
0

In order to handle(reduce/remove) traffic transaction. You have to disable a key useTraffic: false

               dir.route({
                     locations: locations,   // is a var of multiple locations (Lat/lon) 
                        options: {
                            avoids: [],
                            disallows: [],
                            destinationManeuverDisplay: false,
                            doReverseGeocode: false,
                            manMaps: false,
                            sideOfStreetDisplay: false,
                            useTraffic: false
                        }
                    });
                }

Happy Coding...

Hamza Mehmood
  • 151
  • 1
  • 10