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

Get Position info after route change : afterRoute #139

Closed
bkrajendra opened this issue May 24, 2016 · 0 comments
Closed

Get Position info after route change : afterRoute #139

bkrajendra opened this issue May 24, 2016 · 0 comments

Comments

@bkrajendra
Copy link

I'm trying to update my start and end location latitude and longitude information. Is there any way to get this in afterRoute.

function makeRoute()
{
console.log(LocsD);
    var directions = new Maplace({
      map_div: '#gmap',
      generate_controls: true,
      locations: LocsD,
      type: 'directions',
      draggable: true,
      editable: true,
      directions_panel: '#route',
      afterRoute: function(distance,status) {
        $('#km').text((distance/1000)+'km');
            console.log(status);
            var data = {start_latitude: LocsD[0].lat,start_longitude:LocsD[0].lon,end_latitude: LocsD[1].lat,end_longitude:LocsD[1].lon};
            getPrices('https://api.uber.com/v1/estimates/price',data);
      },
      drag: function(index, location, marker) {
        console.log(1);
        console.log(location);
      }
    }).Load();    
    ///directions.Load();
}

My start location and end location data is in LocsD. I want to update this after markers r drag and new route is found. Ive tried using drag, dragend but it never fires.

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