문제

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???

도움이 되었습니까?

해결책

    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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top