afterRoute not passing status or location with draggable #147

Closed
dominikwilkowski opened this Issue Jul 26, 2016 · 1 comment

Comments

2 participants
@dominikwilkowski

Hey there,

I got the below code:

var LocsD = [
    {
        lat: -33.891648,
        lon: 151.282419,
    },
    {
        lat: -33.894282,
        lon: 151.273746,
    }
];

var maplace = new Maplace({
    locations: LocsD,
    map_div: '.js-map',
    generate_controls: false,
    type: 'directions',
    draggable: true,
    afterRoute: function(distance, status, location) {
        console.log(distance);
        console.log(status);
        console.log(location);
    },
}).Load();

This prints the below to the console:

1168
undefined
undefined
1168
OK
Object {geocoded_waypoints: Array[2], routes: Array[1], status: "OK", request: Object}

Not sure why it is triggered twice but my problem is when I drag one of the points the console prints:

1173
undefined
undefined

All subsequent drags will only pass the distance param. Never status or location which is a shame as I need to know what the new route is after the user dragged and changed the route.

What am I missing?

@danielemoraschi

This comment has been minimized.

Show comment
Hide comment
@danielemoraschi

danielemoraschi Aug 8, 2016

Owner

There is a bug at this line, where I'm not passing all the informations by signature: https://github.com/danielemoraschi/maplace.js/blob/master/src/maplace.js#L723
I'll provide a fix as soon as I can.

Thank you

Owner

danielemoraschi commented Aug 8, 2016

There is a bug at this line, where I'm not passing all the informations by signature: https://github.com/danielemoraschi/maplace.js/blob/master/src/maplace.js#L723
I'll provide a fix as soon as I can.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment