Hii,

I try to find polylines by given waypoints.

But if one of the given waypoints can not calculated, error event is
fired.
I mean,

        dirndeneme = new GDirections();

        GEvent.addListener(dirndeneme,"error", function() {
                var polyLine = this.getPolyline();
                //var routess = this.getRoute(0);
                if (!polyLine)
                        {alert('route Null');}
                alert('error');
        });

        GEvent.addListener(dirndeneme,"load", function() {

                var distance = this.getDistance().meters;
                alert('Distance from-to:'+ distance);

                var polyLine = this.getPolyline();
                gMap.addOverlay(polyLine);
        });

        var fromLatLon = 50+","+15;
        var toLatLon = 53+","+12;
        var toLatLon2 = 45+","+5;

var GDirectionsDenemeOption = {getSteps:false, getPolyline:true};

dirndeneme.load("from: " + fromLatLon+ " to: " +  toLatLon + " to: "
+  toLatLon2 , GDirectionsDenemeOption);

This working fine. load event is fired and I can get polyline by
getPolyline method.
But if I add

        var toLatLon3 = 40+","+30;  (In the point in Turkey.)

And load function is:
dirndeneme.load("from: " + fromLatLon+ " to: " +  toLatLon + " to: "
+  toLatLon2 + " to: " +  toLatLon3, GDirectionsDenemeOption);

Because of last point, error event is fired and I can not get previous
polylines.

Is it the case? Or is there a way to get previous (calculated)
polylines?

I think that GDirections can be calculate polylines even if there is
point which can not be calculated.

For example When I try to get polylines by getRoute(i:Number)
function, It may return null for these waypoints.

Why not? Or do I miss something?

Thanks for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to