public CoordinateViewModel FindCoordinate([FromUri] CoordinateViewModel viewModel)
        {
            var result = _geoCodingService.GetFromCoordinate(new Coordinate(viewModel.Latitude, viewModel.Longitude));

            //var result =
            //    new GeoCodingResult
            //    {
            //        City = "Trenton",
            //        Coordinate = new Coordinate(viewModel.Latitude, viewModel.Longitude),
            //        Country = "United States",
            //        State = "NJ"
            //    };

            if (result != null)
            {
                return(_viewModelFactory.Create(result));
            }
            return(null);
        }
Exemple #2
0
        public GeoCodingResult GetFromCoordinate(Coordinate coordinate)
        {
            var key = MakeKey(coordinate);

            return(Get(key, () => _decoratedService.GetFromCoordinate(coordinate)));
        }