Question

i have a question about using the waypoint feature ,i took the script from the User Geocodezip; very big thanks for that ,and it work well ,but

i can only route with waypoint ,i would like to have the waypoints as an option,but if the User let this field empty there is no funktion!? does anyone have an idea???

Was it helpful?

Solution

    if (waypts.options[i].selected == true) {

i insert this line, to Element "waypts" becoming not a mandatory field, but now whole scripts have no funktion.

for (var i = 0; i < waypointstring.length; i++) {
if (waypts.options[i].selected == true) {
 waypts.push({location:waypointstring[i], stopover:true});
   }

}

Finally found the solution :

   var address = waypointstring[i];
if (address !== "") {

here is the whole source example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top