protected override string CreateStringUrl() { var baseUrl = string.Empty; var myCoordonate = MyCoordonate; if (myCoordonate != null && myCoordonate[0] != 0 && myCoordonate[1] != 0) { baseUrl = TypeMap + "/" + TypeFormatResponse + "?" + TypeMapView + "=" + MyCoordonate[0].ToString(CultureInfo.InvariantCulture).Replace(',', '.') + "," + MyCoordonate[1].ToString(CultureInfo.InvariantCulture).Replace(',', '.') + "&destination=" + DestinationCoordonate.ElementAtOrDefault(0).ToString().Replace(',', '.') + "," + DestinationCoordonate.ElementAtOrDefault(1).ToString().Replace(',', '.'); } else { if (Waypoints.Count != 0) { baseUrl = TypeMap + "/" + TypeFormatResponse + "?" + TypeMapView + "=" + Waypoints.ElementAtOrDefault(0)?[0].ToString(CultureInfo.InvariantCulture) .Replace(',', '.') + "," + Waypoints.ElementAtOrDefault(0)?[1].ToString(CultureInfo.InvariantCulture) .Replace(',', '.') + "&destination=" + DestinationCoordonate.ElementAtOrDefault(0).ToString().Replace(',', '.') + "," + DestinationCoordonate.ElementAtOrDefault(1).ToString().Replace(',', '.'); } } var builder = new StringBuilder(); builder.Append(baseUrl); if (Waypoints == null || Waypoints.Count <= 0) { return(builder.ToString()); } builder.Append("&waypoints="); if (Optimization) { builder.Append("optimize:true"); } foreach (var item in Waypoints) { builder.Append("|" + item[0].ToString(CultureInfo.InvariantCulture).Replace(',', '.') + "," + item[1].ToString(CultureInfo.InvariantCulture).Replace(',', '.')); } return(builder.ToString()); }