通过高德定位取温度

123 阅读1分钟
/** * 通过定位实时获取天气数据 */public Observable<LocalWeatherLive> getRunTimeWeatherLive(AMapLocation aMapLocation) {    if (localWeatherLive != null && (System.currentTimeMillis() - lastUpdateLocationTimeForWeather) < GO_LOCATION_WEATHER_TIME) {        return Observable.just(localWeatherLive);    }    return getRegeocodeSearched(MBUtil.getContext(), new LatLonPoint(aMapLocation.getLatitude(), aMapLocation.getLongitude()), 200)            .flatMap(addressModel -> getWeatherLive(MBUtil.getContext(), addressModel.getCity()))            .doOnNext(localWeatherLive -> {                MBLocationManager.this.localWeatherLive = localWeatherLive;                lastUpdateLocationTimeForWeather = System.currentTimeMillis();            })            .observeOn(AndroidSchedulers.mainThread());}