Пример #1
0
 public static IEnumerable <GeocodingResponse> Geocode(MapsApiContext context, IEnumerable <LatLng> locations)
 {
     foreach (var location in locations)
     {
         var request = new GeocodingRequest(location, context);
         yield return(request.GetResponse());
     }
 }
Пример #2
0
        public static IEnumerable <GeocodingResponse> Geocode(MapsApiContext context, IEnumerable <string> addresses)
        {
            var request = new GeocodingRequest(context);

            foreach (var address in addresses)
            {
                request.Address = address;
                yield return(request.GetResponse());
            }
        }
Пример #3
0
        public static IEnumerable <GeocodingResponse> GeocodeAsync(MapsApiContext context, IEnumerable <LatLng> locations)
        {
            var request = new GeocodingRequest(context);

            foreach (var location in locations)
            {
                request.Location = location;
                yield return(request.GetResponseAsync());
            }
        }
Пример #4
0
        public static async Task <IEnumerable <GeocodingResponse> > GeocodeAsync(MapsApiContext context, IEnumerable <LatLng> locations)
        {
            var result  = new List <GeocodingResponse>();
            var request = new GeocodingRequest(context);

            foreach (var location in locations)
            {
                request.Location = location;
                result.Add(await request.GetResponseAsync());
            }

            return(result);
        }
Пример #5
0
        public static async Task <IEnumerable <GeocodingResponse> > GeocodeAsync(MapsApiContext context, IEnumerable <string> addresses)
        {
            var result = new List <GeocodingResponse>();

            foreach (var address in addresses)
            {
                var request = new GeocodingRequest(address, context);
                //request.Address = address;
                result.Add(await request.GetResponseAsync());
            }

            return(result);
        }