public Route(OnlineMapsXML node)
        {
            List <Leg>    legs          = new List <Leg>();
            List <int>    waypointOrder = new List <int>();
            List <string> warnings      = new List <string>();

            foreach (OnlineMapsXML n in node)
            {
                if (n.name == "summary")
                {
                    summary = n.Value();
                }
                else if (n.name == "leg")
                {
                    legs.Add(new Leg(n));
                }
                else if (n.name == "copyrights")
                {
                    copyrights = n.Value();
                }
                else if (n.name == "overview_polyline")
                {
                    overview_polylineD = OnlineMapsUtils.DecodePolylinePointsD(n["points"].Value()).ToArray();
                    overview_polyline  = overview_polylineD.Select(p => (Vector2)p).ToArray();
                }
                else if (n.name == "waypoint_index")
                {
                    waypointOrder.Add(n.Value <int>());
                }
                else if (n.name == "warning")
                {
                    warnings.Add(n.Value());
                }
                else if (n.name == "fare")
                {
                    fare = new Fare(n);
                }
                else if (n.name == "bounds")
                {
                    OnlineMapsXML sw = n["southwest"];
                    OnlineMapsXML ne = n["northeast"];
                    bounds = new OnlineMapsGPXObject.Bounds(sw.Get <double>("lng"), sw.Get <double>("lat"), ne.Get <double>("lng"), ne.Get <double>("lat"));
                }
                else
                {
                    Debug.Log("Route: " + n.name + "\n" + n.outerXml);
                }
            }

            this.legs      = legs.ToArray();
            waypoint_order = waypointOrder.ToArray();
            this.warnings  = warnings.ToArray();
        }
    /// <summary>
    /// Constructor. \n
    /// Use OnlineMapsDirectionStep.TryParse.
    /// </summary>
    /// <param name="node">XMLNode of route</param>
    private OnlineMapsDirectionStep(OnlineMapsXML node)
    {
        start        = node.GetLatLng("start_location");
        end          = node.GetLatLng("end_location");
        duration     = node.Find <int>("duration/value");
        instructions = node.Find <string>("html_instructions");
        GetStringInstructions();
        distance = node.Find <int>("distance/value");

        maneuver = node.Find <string>("maneuver");

        string encodedPoints = node.Find <string>("polyline/points");

        pointsD = OnlineMapsUtils.DecodePolylinePointsD(encodedPoints);
        points  = pointsD.Select(p => (Vector2)p).ToList();
    }
        public Step(OnlineMapsXML node)
        {
            List <Step> steps = new List <Step>();

            foreach (OnlineMapsXML n in node)
            {
                if (n.name == "travel_mode")
                {
                    travel_mode = n.Value();
                }
                else if (n.name == "start_location")
                {
                    start_location = OnlineMapsXML.GetVector2dFromNode(n);
                }
                else if (n.name == "end_location")
                {
                    end_location = OnlineMapsXML.GetVector2dFromNode(n);
                }
                else if (n.name == "polyline")
                {
                    polylineD = OnlineMapsUtils.DecodePolylinePointsD(n["points"].Value()).ToArray();
                    polyline  = polylineD.Select(p => (Vector2)p).ToArray();
                }
                else if (n.name == "duration")
                {
                    duration = new TextValue <int>(n);
                }
                else if (n.name == "distance")
                {
                    distance = new TextValue <int>(n);
                }
                else if (n.name == "step")
                {
                    steps.Add(new Step(n));
                }
                else if (n.name == "html_instructions")
                {
                    html_instructions = n.Value();
                    if (string.IsNullOrEmpty(html_instructions))
                    {
                        return;
                    }
                    string_instructions = OnlineMapsDirectionStep.StrReplace(html_instructions,
                                                                             new[] { "&lt;", "&gt;", "&nbsp;", "&amp;", "&amp;nbsp;" },
                                                                             new[] { "<", ">", " ", "&", " " });
                    string_instructions = Regex.Replace(string_instructions, "<div.*?>", "\n");
                    string_instructions = Regex.Replace(string_instructions, "<.*?>", string.Empty);
                }
                else if (n.name == "maneuver")
                {
                    maneuver = n.Value();
                }
                else if (n.name == "transit_details")
                {
                    transit_details = new TransitDetails(n);
                }
                else
                {
                    Debug.Log("Step: " + n.name + "\n" + n.outerXml);
                }
            }

            this.steps = steps.ToArray();
        }