buche / leaflet-openweathermap

A JavaScript library for including OpenWeatherMap's layers and OWM's current city/station data in leaflet based maps without hassle.
259 stars 132 forks source link

Cities, Stations bounding box query not working #4

Closed sanks87 closed 10 years ago

sanks87 commented 10 years ago

Hi,

EDIT: I may have spoke too soon. It seems to have come back up. But I was curious if the library can be ported to use the latest version of the API anyway ?

I was trying to load your sample example page here and turn on the Cities/Stations checkbox and it does not bring up weather for cities. This used to work just fine up until last week. http://map.comlu.com/openweathermap/

Looked at the json request and its not returning data. I suspect they killed the old end point. I tried to change the api version to 2.5 (seems like thats the current) but there is no example on their site to construct a bounding box query for v2.5. I was wondering if you would know about it?

Example query that does not work: http://api.openweathermap.org/data/2.1/find/city?bbox=-89.4561767578125,41.76106872528616,-85.9405517578125,42.69252994883861,10&callback=L.OWM.Utils.callbacks[0]

Great leaflet port by the way! Thanks

buche commented 10 years ago

Cities checkbox is working for me. Looks like a glitch on OWM's side. OWM doesn't return station data for api version 2.1 at the moment. Maybe I'll take this as a sign to update to api 2.5 ... but this will have to wait for some days.

buche commented 10 years ago

Just for information: Current weather (cities, stations) now uses OWM API 2.5 because API 2.1 returns no data increasingly frequent. But API 2.5 somtimes returns syntactically incorrect JSON data, which will stop JavaScript processing. Moving or stopping/starting the data layer helps most of the time to get correct data from OWM.