Ejemplo n.º 1
0
        public async Task <IActionResult> GetByPoint(double lat, double lon, double radius, int limit = 1000)
        {
            try
            {
                var placeInfos = await _placeProvider.GetShortPlaceInAreaAsync(new Geolocation(lat, lon), radius, limit).
                                 ConfigureAwait(false);

                var areaItems = new AreaItemsList <PlaceInfo>()
                {
                    Latitude  = lat,
                    Longitude = lon,
                    Radius    = radius,
                    Items     = placeInfos.ToList()
                };

                return(new ObjectResult(areaItems));
            }
            catch
            {
                return(BadRequest());
            }
        }