コード例 #1
0
        public void Encode_set_but_not_all_LatLng_positions()
        {
            StaticMapRequestAccessor accessor = new StaticMapRequestAccessor();

            LatLng first = new LatLng(30.0, -60.0);
            Location second = new Location("New York");
            accessor.Path = new Path(first, second) { Encode = true };

            string expected = null;//expecting an Exception
            string actual = accessor.GetPathsStr();

            Assert.Fail("Expected an InvalidOperationException because first point was LatLng but second point was Location.");
        }
コード例 #2
0
 /// <summary>
 /// Adds a waypoint to the current request.
 /// </summary>
 /// <remarks>Google's API specifies 8 maximum for non-business (free) consumers, and up to 23 for (registered) business customers</remarks>
 /// <param name="waypoint"></param>
 public void AddWaypoint(Location waypoint)
 {
     if(waypoint == null) return;
     if(_waypoints == null) _waypoints = new List<Location>();
     _waypoints.Add(waypoint);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: HyperionTech/TSPGMaps
 public Directions(Location start, Location stop)
 {
     _start = start;
     _stop = stop;
     Calculate();
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: HyperionTech/TSPGMaps
 private double Distance(Location a, Location b)
 {
     return new Directions(a, b).Distance;
 }
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="destination"></param>
 public void AddOrigin(Location destination)
 {
     WaypointsOrigin.Add(WaypointsOrigin.Count, destination);
 }
コード例 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="destination"></param>
 public void AddDestination(Location destination)
 {
     WaypointsDestination.Add(WaypointsDestination.Count, destination);
 }