예제 #1
0
        public void ShouldDecodePolylineWithPointsThatWereCloseTogether()
        {
            const string polyline    = "krk{FdxdlO?e@";
            var          multiPoints = new List <PolylineCoordinate>
            {
                new PolylineCoordinate {
                    Latitude = 41.35222, Longitude = -86.04563
                },
                new PolylineCoordinate {
                    Latitude = 41.35222, Longitude = -86.04544
                }
            };

            var polylineComparer = new PolylineCoordinateComparer();

            CollectionAssert.AreEqual(multiPoints.ToList(), Polyline.DecodePolyline(polyline).ToList(), polylineComparer);
        }
예제 #2
0
        public void ShouldDecodePolyline()
        {
            const string polyline    = "_p~iF~ps|U_ulLnnqC_mqNvxq`@";
            var          multiPoints = new List <PolylineCoordinate>
            {
                new PolylineCoordinate {
                    Latitude = 38.5, Longitude = -120.2
                },
                new PolylineCoordinate {
                    Latitude = 40.7, Longitude = -120.95
                },
                new PolylineCoordinate {
                    Latitude = 43.252, Longitude = -126.453
                }
            };

            var polylineComparer = new PolylineCoordinateComparer();

            CollectionAssert.AreEqual(multiPoints.ToList(), Polyline.DecodePolyline(polyline).ToList(), polylineComparer);
        }