mirror of
				https://github.com/MichMich/MagicMirror.git
				synced 2025-10-31 10:48:10 +00:00 
			
		
		
		
	Support showing wind direction with an arrow
As described in https://github.com/MichMich/MagicMirror/issues/871 this feature lets user use arrow instead of an abbreviation for wind directions. This can be especially helpful on languages like Finnish that do not have all the compass directions English has.
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							a6485b61a4
						
					
				
				
					commit
					0e486b45e1
				
			| @@ -94,6 +94,7 @@ Module.register("currentweather",{ | ||||
|  | ||||
| 		this.windSpeed = null; | ||||
| 		this.windDirection = null; | ||||
| 		this.windDeg = null; | ||||
| 		this.sunriseSunsetTime = null; | ||||
| 		this.sunriseSunsetIcon = null; | ||||
| 		this.temperature = null; | ||||
| @@ -122,7 +123,13 @@ Module.register("currentweather",{ | ||||
|  | ||||
| 		if (this.config.showWindDirection) { | ||||
| 			var windDirection = document.createElement("sup"); | ||||
| 			windDirection.innerHTML = " " + this.translate(this.windDirection); | ||||
| 			if (this.config.showWindDirectionAsArrow) { | ||||
| 				if(this.windDeg !== null) { | ||||
| 					windDirection.innerHTML = "  <i class=\"fa fa-long-arrow-down\" style=\"transform:rotate("+this.windDeg+"deg);\"></i> "; | ||||
| 				} | ||||
| 			} else { | ||||
| 				windDirection.innerHTML = " " + this.translate(this.windDirection); | ||||
| 			} | ||||
| 			small.appendChild(windDirection); | ||||
| 		} | ||||
| 		var spacer = document.createElement("span"); | ||||
| @@ -329,6 +336,7 @@ Module.register("currentweather",{ | ||||
|  | ||||
|  | ||||
| 		this.windDirection = this.deg2Cardinal(data.wind.deg); | ||||
| 		this.windDeg = data.wind.deg; | ||||
| 		this.weatherType = this.config.iconTable[data.weather[0].icon]; | ||||
|  | ||||
| 		var now = new Date(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user