qinbo
2021-10-28 8fc47cda4a841395deb71ae7c5659f8d3d7ca19e
天气图标 bug fix
1个文件已修改
23 ■■■■■ 已修改文件
widgetsTS/weather/widget.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
widgetsTS/weather/widget.js
@@ -30,7 +30,7 @@
    reloadData(params) {
      $.getJSON(mars3d.global_variables.nodejs_url_predix + "dataapi/Bdata?bid=get_weather_" + mars3d.global_variables.queryDataType + "&datatime=" + mars3d.global_variables.queryDataTStart + "&siteid=" + mars3d.global_variables.weathercitycode, (result) => {
        if (result.data.result.length > 0 ){
        if (result.data.result.length > 0 && mars3d.global_variables.queryDataType == "hour"){
          var current_weather = result.data.result[0];
        //var current_weather = { "temp": "25", "feelsLike": "29", "icon": "150", "text": "晴", "wind360": "90", "windDir": "东风", "windScale": "0", "windSpeed": "0", "humidity": "88", "precip": "0.0", "pressure": "1009", "vis": "16", "cloud": "3", "dew": "23" };
        $("#weather_temp").html(current_weather.temp);
@@ -50,7 +50,28 @@
        var wind = this.map.getLayerById(2001);
        wind.data = this.createWindData();
        }else if(result.data.result.length > 0 && mars3d.global_variables.queryDataType == "day"){
          var current_weather = result.data.result[0];
          $("#weather_temp").html(current_weather.temp);
          $("#weather_text").html(current_weather.textday);
          $("#weather_icon").attr('src', './img/qweather/' + current_weather.iconday + '.svg');
          $("#weather_windScale").html(current_weather.windscaleday);
          $("#weather_windDir").html(current_weather.winddirday);
          $("#weather_feelsLike").html(current_weather.feelslike);
          $("#weather_humidity").html(current_weather.humidity);
          $("#weather_pressure").html(current_weather.pressure);
          $("#weather_precip").html(current_weather.precip);
          $("#weather_vis").html(current_weather.vis);
          $("#weather_dew").html(current_weather.dew);
          mars3d.global_variables.wind360 = current_weather.wind360day;
          mars3d.global_variables.windSpeed = current_weather.windSpeed==0?1:current_weather.windspeedday;
          var wind = this.map.getLayerById(2001);
          wind.data = this.createWindData();
        }
        
      });
    }