Open Weather Map layers

764 views
Skip to first unread message

Brent Shanahan

unread,
Dec 9, 2015, 11:24:45 AM12/9/15
to cesium-dev
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!

Scott Hunter

unread,
Dec 9, 2015, 11:41:05 AM12/9/15
to cesiu...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brent Shanahan

unread,
Dec 10, 2015, 11:06:20 AM12/10/15
to cesium-dev
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:

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

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!
Clouds.JPG

Davor Fiedler

unread,
May 24, 2017, 12:54:03 PM5/24/17
to cesium-dev
Hello,

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

Thx,
Davor

robert.o...@gmail.com

unread,
May 28, 2017, 3:23:30 PM5/28/17
to cesium-dev
Op woensdag 24 mei 2017 18:54:03 UTC+2 schreef Davor Fiedler:

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.

Davor Fiedler

unread,
May 28, 2017, 7:38:06 PM5/28/17
to cesium-dev, robert.o...@gmail.com
Thanks a lot Roberto.
Working now !

Best regards,
Davor


Reply all
Reply to author
Forward
0 new messages