-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from frankhommers/master
Enhanced Avoid and added Available
- Loading branch information
Showing
8 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
|
||
namespace Google.Maps | ||
{ | ||
/// <summary> | ||
/// Directions may be calculated that adhere to certain restrictions. | ||
/// Restrictions are indicated by use of the avoid parameter, and an | ||
/// argument to that parameter indicating the restriction to avoid. | ||
/// </summary> | ||
[Flags] | ||
public enum Avoid | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
none = 0, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
highways = 1, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
tolls = 2, | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
ferries = 4 | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Google.Maps | ||
{ | ||
internal static class AvoidHelper | ||
{ | ||
internal static string MakeAvoidString(Avoid avoid) | ||
{ | ||
var sb = new StringBuilder(); | ||
foreach (Avoid avoidFlag in Enum.GetValues(typeof (Avoid))) | ||
{ | ||
if (avoidFlag != 0 && ((avoid & avoidFlag) == avoidFlag)) | ||
sb.Append((sb.Length > 0 ? "|" : "") + avoidFlag.ToString()); | ||
} | ||
return sb.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters