openweathermap

how to display openweathermap weather icon

半腔热情 提交于 2020-01-20 17:30:19
问题 I am using openweathermap to display weather reports. Everything is working fine but there is a problem with the icon . The json response code are : Array ( [city] => Array ( [id] => 1271476 [name] => Guwahati [coord] => Array ( [lon] => 91.751 [lat] => 26.1862 ) [country] => IN [population] => 899094 ) [cod] => 200 [message] => 0.0630711 [cnt] => 1 [list] => Array ( [0] => Array ( [dt] => 1495688400 [temp] => Array ( [day] => 33 [min] => 24.89 [max] => 33.82 [night] => 24.89 [eve] => 30.6

How do I get geolocation in openweather API

时光毁灭记忆、已成空白 提交于 2020-01-07 03:04:24
问题 How do I get mu openweather API to work with geolocation? This is my current html code: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"> <link rel="stylesheet" href="main.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type='text/javascript' src='app.js'></script> </head> <body> <div class="jumbotron"> <button onclick="getLocation()">Get my location.<

OpenWeatherMap API vs Wunderground API?

↘锁芯ラ 提交于 2019-12-29 06:32:07
问题 I don't see a lot of information available comparing the weather APIs that are available. What is the difference between OpenWeatherMap and Wunderground. I see that the paid version of Wunderground has some higher tiers with more features, but OpenWeatherMap's free tier allows a huge number of uses. Are there implementation tradeoffs that aren't obvious? 回答1: Here's a comparison of different weather forecast APIs: 7 Weather Forecast API for Developing Apps It contains a comparison of the

OpenWeatherMap API vs Wunderground API?

倾然丶 夕夏残阳落幕 提交于 2019-12-29 06:32:05
问题 I don't see a lot of information available comparing the weather APIs that are available. What is the difference between OpenWeatherMap and Wunderground. I see that the paid version of Wunderground has some higher tiers with more features, but OpenWeatherMap's free tier allows a huge number of uses. Are there implementation tradeoffs that aren't obvious? 回答1: Here's a comparison of different weather forecast APIs: 7 Weather Forecast API for Developing Apps It contains a comparison of the

Can't perform what seems like a simple HTTP POST to openweathermap.org

不羁岁月 提交于 2019-12-17 20:39:27
问题 My function in an Angular service component to POST a request to create a new weather station with openweathermap.org: registerStation(registerWeatherStation: RegisterWeatherStation): Observable<Response> { let params = JSON.stringify(registerWeatherStation) console.log("params: ",params) let header = new Headers({'Content-Type': 'application/json; charset=utf-8'}) let options = new RequestOptions({ headers: header }) let url = this.servUrl + 'stations?appid=' + this.weatherAppId return this

Using OpenWeatherMap API gives 401 error

孤人 提交于 2019-12-13 13:48:00
问题 I'm trying to get the weather data for London in JSON but I am getting HTTPError: HTTP Error 401: Unauthorized . How do I get the API working? import urllib2 url = "http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=10&mode=json&units=metric" response = urllib2.urlopen(url).read() 回答1: The docs open by telling you that you need to register for an API key first. To access the API you need to sign up for an API key Since your url doesn't contain a key, the site tells you you're

keyNotFound(CodingKeys(stringValue: “coord”, intValue: nil)

≯℡__Kan透↙ 提交于 2019-12-13 09:13:48
问题 I am building a small swift weather app using the openweatherAPI and I am running into some issues trying to parse the JSON. I have used the following function to parse the get and parse the json. Below is my weather data struct: struct WeatherData: Codable { let coord: Coord let weather: [Weather] let base: String let main: Main let visibility: Int let wind: Wind let clouds: Clouds let dt: Int let sys: Sys let id: Int let name: String let cod: Int } struct Clouds: Codable { let all: Int }

OpenWeatherMap and Swift 4

六月ゝ 毕业季﹏ 提交于 2019-12-13 03:42:22
问题 I am trying to build a simple weather app using OpenWeatherMap APIs in Swift 4. I can parse Json data in simple cases, but this one has a more complex structure. This is the Json file the API returns. {"coord":{"lon":144.96,"lat":-37.81},"weather":[{"id":520,"main":"Rain","description":"light intensity shower rain","icon":"09n"}],"base":"stations","main":{"temp":288.82,"pressure":1019,"humidity":100,"temp_min":288.15,"temp_max":289.15},"visibility":10000,"wind":{"speed":4.1,"deg":200},"clouds

jQuery ajax call with OpenWeatherMap - net::ERR_CONNECTION_REFUSED

。_饼干妹妹 提交于 2019-12-11 06:51:21
问题 I want to get weather from OpenWeatherMap API based on latitude and longitude, but I'm getting error net::ERR_CONNECTION_REFUSED Project is on codepen.io var appid = "myID"; function getLocation() { $.getJSON('https://geoip-db.com/json/geoip.php?jsonp=?') .done (function(location) { $('.country').html(location.country_name); $('.city').html(location.city); var lat = location.latitude; var lon = location.longitude; var weatherLink = "https://api.openweathermap.org/data/2.5/weather?lat=" + lat

openweathermap weather tile in Leaflet in R

南楼画角 提交于 2019-12-10 11:42:33
问题 I am trying to add custom weather tiles on a leaflet map in a Shiny application using leaflet-openweathermap javascript library available here. I am not conversant with javascript and the map doesn't render the weather layers. I first downloaded leaflet-openweathermap.js and placed it in www/js folder in my app's path. I then registered the plugin: openWeatherPlugin <- htmlDependency( "Leaflet.OpenWeather", "1.6.0", src = normalizePath(path = getwd()), script = "www/js/leaflet.openweathermap