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.");
        }
 /// <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
 public Directions(Location start, Location stop)
 {
     _start = start;
     _stop = stop;
     Calculate();
 }
Пример #4
0
 private double Distance(Location a, Location b)
 {
     return new Directions(a, b).Distance;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="destination"></param>
 public void AddOrigin(Location destination)
 {
     WaypointsOrigin.Add(WaypointsOrigin.Count, destination);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="destination"></param>
 public void AddDestination(Location destination)
 {
     WaypointsDestination.Add(WaypointsDestination.Count, destination);
 }