Any help with constructing locations?

2 posts / 0 new
Last post
CDA
Any help with constructing locations?

I have a list of page elements which contain latitudes/longitudes which my user can rearrange at will which I then need to iterate through and build the locations array to pass to mapquest's leaflet.js routing plugin and I don't seem to be able to wrap my head around why it's not working... Can anyone shed any light on it?

var temproute = new Array();
$('.route').each(function() {
    var latlngitems = {};
    var locationitems = {};
    var locationobject = {};
    var latlng = $(this).val().split(",");
    latlngitems['lat'] = latlng[0];
    latlngitems['lng'] = latlng[1];
    locationitems['latlng'] = latlngitems;
    temproute.push(locationitems);
});
route.route({
    locations: temproute,
    options: [{
        allToAll: false,
        doReverseGeocode:false
    }]
});


MQBrianCoakley
What is the output created by
What is the output created by the code above? What does the request to mapquestapi.com look like?