Open Weather Map layers

Has anyone implemented the weather layers from Open Weather Map into Cesium yet?

If so, could you provide an example on how you set up the webMapTileServiceImageryProvider? Where to find tileMatrixSetID for the layer?

I figured I would ask before I spend a day or two fiddling around to figure it out. If no one has done it yet I will let everyone know how I do it once I figure it out.

Thanks!

Appears to be OpenStreetMap-style tiles. http://openweathermap.org/tile_map

I tested and they don’t support CORS headers so you’ll have to proxy, or convince them to fix their server.

var clouds = imageryLayers.addImageryProvider(new Cesium.OpenStreetMapImageryProvider({
url : ‘http://a.tile.openweathermap.org/map/clouds’,
fileExtension : ‘png’,
tileMatrixSetID : ‘a’,
proxy: new Cesium.DefaultProxy(’/proxy/’)
}));

``

Pointing that it uses OpenStreetMap tiles was actually a huge help, I missed that.

Getting
it displaying was pretty simple after that, using Cesium’s support for OpenStreetMap style tiles. I just had to copy the default proxy provider
from the nodejs server that comes with Cesium into my nodejs server.

After that was done the layers can be provided using the following:

Easy enough!

It’s
missing small bits at the poles but that’s irrelevant to what I need it for but figure I would point it out for anyone in the future that wants to use OpenWeatherMap layers in their app. (image attached for those who are curious)

Thanks for the help!

Hello,

pls do you have update on this since config change a bit - https://openweathermap.org/api/weathermaps#clouds

Thx,
Davor

Hi Davor,

I got the updated OpenWeatherMap interface working with the following code:

    var mapOpenWeatherMaps = layers.addImageryProvider(
  new Cesium.createOpenStreetMapImageryProvider( {
            url: ‘http://tile.openweathermap.org/map/precipitation_new’,
            fileExtension: ‘png’ + ‘?appid={APPID}’
            })
  );

OpenWeatherMaps requires your own unique AppID with each request and it is required to be the last entry of the url, hence the 'hack' where the AppID is added after the image-type.
So in the code above replace {APPID} with your own unique ID when you subscribe to the OpenWeatherMap site.

Thanks a lot Roberto.
Working now !

Best regards,
Davor