Ejemplo n.º 1
0
        private FloodDataResultModel Convert_Flood_Data_To_Model_Properties(FloodMapResponse flood_map, FloodDataResultModel model)
        {
            var flood_map_result =
                flood_map
                .result
                .bfelist
                .FirstOrDefault();

            if (flood_map_result != null)
            {
                model.Elevation = flood_map_result.elev;
                model.BaseFloodElevationAvailable = true;
            }

            return(model);
        }
Ejemplo n.º 2
0
        internal async Task <FloodMapResponse> Get_Flood_Map_By_Coordinates(double latitude, double longitude)
        {
            var url =
                Common.URL
                .WithHeader(Common.API_KEY_PARAMETER, Common.API_KEY)
                .AppendPathSegment(Common.FLOOD_MAP_API_PATH_SEGMENT)
                .SetQueryParams(new MapCoordinatesSearchModel
            {
                lat = latitude,
                lng = longitude
            });

            FloodMapResponse data = await url.GetJsonAsync <FloodMapResponse>();

            return(data);
        }
Ejemplo n.º 3
0
        internal FloodDataResultModel Convert_Flood_API_Data_To_Flood_Model(FloodDataResponse flood_data, FloodMapResponse flood_map)
        {
            FloodDataResultModel model = new FloodDataResultModel();

            Convert_Flood_Data_To_Model_Properties(flood_data, model);

            Convert_Flood_Data_To_Model_Properties(flood_map, model);

            return(model);
        }