| | |
| | | |
| | | 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); |
| | |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | }); |
| | | } |