我正在尝试使用与用户所在位置相关的箭头图标来显示风的方向。应调整箭头以反映风向的任何变化。
目前我正在使用OpenWeatherMap API来获取风向。它以度为单位返回风。请参阅下面的代码。
OwmClient owm = new OwmClient();
WeatherStatusResponse currentWeather = owm.currentWeatherAroundPoint(53.326699f,-6.350769f,1);
WeatherData weather = currentWeather.getWeatherStatus().get(0);
double currentWindSpeed = weather.getWind().getSpeed() * 2.236936;
int windDirection = weather.getWind().getDeg();
System.out.print("Wind Direction is " + windDirection)
但是我想获取此返回值并使用箭头显示风向,该箭头将相对于用户正在移动的方向进行更改/调整。
或者,如果更容易给出位置的经度和纬度,则相对于该点显示风向相同。
我很感激有关如何解决这个问题的任何帮助。