Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

precipitation_new map layer not showing snow

FSDuncan May 19, 2017 06:17PM UTC

I've added the precipitation_new map layer to a Mapbox GL Js map, it shows up as a dark purple overlay but the example in the API docs shows bright purple and bright blue for snow.
Is there a way to control the opacity of the shapes (if I want to show them on a dark background), or toggle the snow layer as well?

Up 0 rated Down
Maxim Gushcho May 22, 2017 03:00PM UTC OpenWeatherMap Agent

Hello,

Could you please provide an API call you make for reaching weather layers?

Thanks.

Up 0 rated Down
FSDuncan May 30, 2017 04:48PM UTC
The code I'm using is like this:
// add source to map
this.map.addSource('weatherSource', {
type: 'raster',
tiles: [`http://tile.openweathermap.org/map/precipitation_new/{z}/{x}/{y}.png?appid=${cfg.weather.apiKey}`],
});

this.map.addLayer({
id: 'weatherSource',
source: 'weatherSource',
type: 'raster',
minzoom: 0,
maxzoom: 22,
});

Note the tile URL is specifically:
http://tile.openweathermap.org/map/precipitation_new/{z}/{x}/{y}.png

And that's not showing any blue snow areas at all for me.
Up 0 rated Down
Maxim Gushcho May 31, 2017 03:36PM UTC OpenWeatherMap Agent

Hello,

Check this link with your api key:
http://tile.openweathermap.org/map/precipitation_new/0/0/0.png?appid=xxxx

Up 0 rated Down
FSDuncan May 31, 2017 08:55PM UTC
That's the url format I'm using, it shows the faint purple smudge design I'm seeing on my map. I'll clarify what I'm talking about:

The example link in the API points to this example app:

https://openweathermap.org/weathermap?basemap=map&cities=true&layer=precipitation&lat=30&lon=-20&zoom=3

As of today when I checked, it's showing the same purple map tiles as above (although the tile url is different: f.maps.owm.io... and the map legend still refers to bright blue for snow). The map currently shows no snow in the world.

When I was looking at it a few days ago, it was using a different tile set for precipitation (b.maps.owm.io...) and it showed vivid blue areas to indicate snow.

Here's an example of the tiles coming from the live API and the link you provided above:

https://i.pictr.io/QEiVV.png

Here's the same tile coming from the server I was seeing a few days ago, note the blue areas:

https://i.pictr.io/QEKFh.png
Up 0 rated Down
Maxim Gushcho Jun 01, 2017 12:16PM UTC OpenWeatherMap Agent

Please only use URLs that specified here:
http://openweathermap.org/api/weathermaps

Up 0 rated Down
FSDuncan Jun 01, 2017 05:50PM UTC
So to my original questions,(Can I show snow precipitation, Can I make it look good on a dark background), the answers are both "No."
Up 0 rated Down
Maxim Gushcho Jun 05, 2017 12:29PM UTC OpenWeatherMap Agent

Hello,

You can show snow precipitations on the map:
http://tile.openweathermap.org/map/snow_new/0/0/0.png?appid=xxxxxx

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete