Inheritance: ILocationString
コード例 #1
0
ファイル: GoogleFunctions.cs プロジェクト: vivet/GoogleApi
        /// <summary>
        /// Merge polylines into one encoded polyline string.
        /// </summary>
        /// <param name="encdodedLocations"></param>
        /// <returns></returns>
        public static string MergePolyLine(params string[] encdodedLocations)
        {
            if (encdodedLocations == null)
                throw new ArgumentNullException(nameof(encdodedLocations));

            var length = encdodedLocations.Length;
            var locations = new Location[length];

            locations = encdodedLocations.Where(x => !string.IsNullOrEmpty(x)).Aggregate(locations, (current, encdodedLocation) => current.Concat(GoogleFunctions.DecodePolyLine(encdodedLocation)).ToArray());

            return GoogleFunctions.EncodePolyLine(locations);
        }
コード例 #2
0
ファイル: GoogleMapsTest.cs プロジェクト: vivet/GoogleApi
        public void TimeZoneTest()
        {
            var location = new Location(40.7141289, -73.9614074);
            var request = new TimeZoneRequest { Location = location };
            var response = GoogleMaps.TimeZone.Query(request);

            Assert.IsNotNull(response);
            Assert.AreEqual(Status.Ok, response.Status);
            Assert.AreEqual("America/New_York", response.TimeZoneId);
            Assert.AreEqual("GMT-05:00", response.TimeZoneName);
            Assert.AreEqual(0.00, response.OffSet);
            Assert.AreEqual(-18000.00, response.RawOffSet);
        }