Get Position info after route change : afterRoute #139

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

Comments

2 participants
@bkrajendra

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