Select to view content in your preferred language

get weather information

2246
4
07-04-2017 03:42 AM
FaryalSafdar
New Contributor

i wanted to display weather information of the current map location. i have got current map location by using following code 

var x = map.extent.getCenter().getLatitude();
var y = map.extent.getCenter().getLongitude();

document.getElementById("txtx").value = x;
document.getElementById("txty").value = y;

but now i am stuck to how to get weather information. 

0 Kudos
4 Replies
EvelynHernandez
Occasional Contributor III

If u have the weather info as a layer (as rest service) u can use it on the map with map.addLayer() function.

0 Kudos
FaryalSafdar
New Contributor

no i meant like weather widget it display info like current temperature etc. i donot have weather info as layer

0 Kudos
AndrewFarrar
Occasional Contributor

Faryal, there is no prebuilt widget that I know of to do this.  You will need to create or locate a weather service to bring into your application.  Just doing a quick google search brings up a couple of things that may help you.  

Public Information Map 

This is an ArcGIS Online map that contains a radar service, NOAA weather alerts, and it looks like an accuweather service.  

https://www.arcgis.com/home/item.html?id=d16d53126f1243a3a7a7f1d0dff39662 

This is the webmap that powers the above application.  The layers in the map may be of particular use to you. 

0 Kudos
arunepuri1
New Contributor III

Hi Faryal,

Do you got any solution or rest service to get current weather details based on lat,long. I am also in the same boat.

Thanks,

Arun E

0 Kudos