Cannot read property 'alternateRoutes' of undefined

4 posts / 0 new
Last post
Cannot read property 'alternateRoutes' of undefined

Hi !

I get this error : Uncaught TypeError: Cannot read property 'alternateRoutes' of undefined  in:mq-routing.js?key=this_is_my_key :61

the error is at : var J=Q.route.alternateRoutes;

There the code i have

function createTrajet(dusList) {
            GroupLatLng = [];
            for (var i = 0; i < dusList.length; i++) {

                var latLng = { lat: dusList[i].Lattitude, lng: dusList[i].Longitude};

mapTrajet ='trajetMap', {
                layers: MQ.mapLayer(),
                center: [46.814184, -71.207425],//Centre la carte sur Québec
                zoom: 14

            dir = MQ.routing.directions();
                locations: GroupLatLng

                directions: dir,
                fitBounds: true

Thank you for your help.

Hi Joey,
Hi Joey,   Is there a url where we can see this happening?

Nervermind,it was on my side

Nervermind,it was on my side,in the part where i build latLng i should have done : var location = {latLng:{ lat: dusList[i].Lattitude, lng: dusList[i].Longitude };

Thank you for your time !

Thanks for letting us know!
Thanks for letting us know!