javascript - Is possible to add waypoints to Google Maps API without using JSON? -
i'm on asp.net mvc , i'm using google maps api javascript. send model view 1 or more waypoints add route.
function calcroute() { initialize(); var start = "<%= model.startaddress %>"; var end = "<%= model.clientaddress %>"; var waypts = []; waypts.push({ location: "<%= model.pickupaddress[0] %>", stopover:true }); var request = { origin: start, destination: end, waypoints: waypts, travelmode: google.maps.directionstravelmode.driving }; directionsservice.route(request, function (response, status) { if (status == google.maps.directionsstatus.ok) { directionsdisplay.setdirections(response); } }); }
is possible add waypoints way addresses in model.pickupaddress array? have seen examples code using json (for markers), if can directly in javascript code, that's fine me.
Comments
Post a Comment