Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

afterRoute not passing status or location with draggable #147

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

afterRoute not passing status or location with draggable #147

dominikwilkowski opened this issue Jul 26, 2016 · 1 comment

Comments

@dominikwilkowski
Copy link

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
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants