Jon Garrido Martin GIS Developer

GIS Developer Freelance

API Rest Forecast.IO

By jongarrido | September 2, 2015 | 0 Comment

In this post I’ll explaine how to access to Api Rest using esri.request call.

It’s as simple as make the call and mange the callback function:

var url = '';
var latlon = [feature.geometry.getLatitude(),feature.geometry.getLongitude()].join(',');var req = esri.request({
url: url + latlon,
content: {
units: 'si' // celsius, km/h
handleAs: "json",
callbackParamName: "callback"

The event to mange the callback:
//some examples
console.log(data.currently.summary)  // Weather summary for now..
console.log([0].summary)  // Weather summary for tomorrow..
console.log(data.currently.windBearing) // Azimut for current wind ...

Thanks to Javier Abadia (ESRI Spain) for his demo at the ESRI user conference 2013 in Madrid.

A simple example: here


Leave a Reply

Your email address will not be published. Required fields are marked *