Blog

Updates, examples and tips from the inside.

Aeris Web: JavaScript SDK Preview

by nshipes on Feb 08, 2012

Over the past few weeks, we’ve been actively working on the first component to Aeris Web -- the JavaScript SDK. We are continuing to test and wrap up all items required for our version 1.0 slated for release within a couple of weeks, but we wanted to provide a preview of how easy it will be to incorporate your Aeris API subscription into your custom web applications.

For instance, if you wanted to fetch the latest weather observations for Seattle, WA, you would just need to use the following snippet once you have initialized the Aeris JS SDK with your access information:


var obs = new Aeris.collections.Observations();
obs.bind('load', function(collection){
	var model = collection.at(0);
	alert('Currently in Seattle it is ' + model.get('ob.tempF') + ' degrees.');
});
obs.fetch('seattle,wa');

The same properties from the core data API are also used in the JavaScript SDK, so switching between the two formats is straightforward.

Built-In Widgets
We will also be including a set of basic built-in JavaScript widgets that you can include in your application that are fully customizable using CSS and custom templates. The following is an example of using our built-in Advisories widget that loads advisories for Birmingham, AL and renders it to a <div> whose id is “widget-advisories”:


var advisories = new Aeris.widgets.Advisories($('#widget-advisories'), {
	params: {
		p: 'birmingham,al'
	}
});

All of our HTML templates are based on Handlebars JS, so it is very easy and quick to customize any of the built-in widgets or creating your own by extending our core objects.

Below are screenshots of some of the built-in widgets that will come with the Aeris JavaScript SDK.

 

Our included widgets also support additional features, like displaying data based on the user's geolocation or allowing them to view the data for a particular location they can search for. Additionally, widgets can be configured to auto-refresh its data based on a specific time interval, so you can ensure your data is always up to date no matter how long the page is open or application running.

We will be posting additional updates as we get closer to the official release of version 1.0 of the JavaScript SDK.

posted in Aeris Web, News, What's New

Submit a comment

Comments

  • There are no comments for this entry.

Archive