by nshipes on May 16, 2012
In addition to its quick and easy implementation, another exciting component of our Aeris iOS Weather framework is our interactive weather map feature. This component is a completely functional map with Aeris weather data and imagery overlaid on top of it which you hvae complete control over.

Our demo application that comes with the framework distribution has a basic example of how you could integrate the interactive weather map into your own custom iPhone and iPad applications. We have even provided a simple options view for users to control which weather overlays are currently displayed on the map. When using this built-in view for your map options, only those overlays your Aeris API account level has access to will be displayed.

Changing the Map Options
You may wish to use the built-in map options view in your map as is, but adjust the options that are displayed. To achieve this, simply set the sections property on your AFWeatherMapOptionsViewController instance with the options you wish to use instead. Your custom value should be an NSArray of NSDictionary objects for each section in your options table. The default value for the sections property is:
self.sections = [[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"Overlays", @"section", overlays, @"rows", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"Point Data", @"section", pointdata, @"rows", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"Map Type", @"section", mapTypes, @"rows", nil],
nil];
Then the value you provide for the rows key in each NSDictionary instance should be an array of NSDictionary instances providing the information for each row, which should include keys for code and name. For example, the mapTypes variable above, which changes the type of Google base map displayed, would be defined as:
NSArray *mapTypes = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"standard", @"code", @"Standard", @"name", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"satellite", @"code", @"Satellite", @"name", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"hybrid", @"code", @"Hybrid", @"name", nil],
nil];
For weather overlays, the codes for each row correspond to an AFTileOverlayType or AFPointDataType and are listed on the documentation for our interactive map. These codes must match exactly in order for the options to work. However, you can set the name value to anything of your liking.
You may find that sticking with the standard iOS views is likely too basic for your own application. Using some of the available methods on the weather map instance you can create more custom implementations depending on your stylistic and functional needs. Before getting started, make sure to review the public properties and methods available in AFWeatherMap instances.
Toggling Map Overlays
There are two ways for turning weather overlays on and off on your map: using toggleOverlayForType: and have the internal overlay manager determine when to show and hide the overlay, or combining showOverlayForType: and hideOverlayForType: to control when overlays should appear or be removed. Note that these methods are for tile overlays only, but the same types of methods are available for point data overlays (togglePointDataOverlayForType:, showPointDataOverlayForType:, hidePointDataOverlayForType:). The only option you need to pass these methods is the overlay type from AFOverlayType (or AFPointDataType) you want to apply the action to.
For instance, you have a custom toolbar containing buttons for each overlay you want to enable on your map, one of which is a button to toggle the radar tile overlay. Your selector for the button’s UIControlEventTouchUpInside event would use the above methods on your AFWeatherMap instance to control the radar overlay’s visibility.
- (void)toggleRadarOverlay {
// ask the framework's internal overlay manager if this overlay is currently active on the map
if ([self.weatherMap hasOverlayForType:AFTileOverlayTypeRadar] == YES) {
[self.radarOverlayButton setSelected:NO];
[self.weatherMap hideOverlayForType:AFTileOverlayTypeRadar];
}
else {
[self.radarOverlayButton setSelected:YES];
[self.weatherMap showOverlayForType:AFTileOverlayTypeRadar];
}
}
You could also use toggleOverlayForType:
- (void)toggleRadarOverlay {
// ask the framework's internal overlay manager if this overlay is currently active on the map
if ([self.weatherMap hasOverlayForType:AFTileOverlayTypeRadar] == YES) {
[self.radarOverlayButton setSelected:NO];
[self.weatherMap hideOverlayForType:AFTileOverlayTypeRadar];
}
else {
[self.radarOverlayButton setSelected:YES];
[self.weatherMap showOverlayForType:AFTileOverlayTypeRadar];
}
}
Our next tutorial topic will cover how to use custom annotations and annotation views in your own map.
...
Read more...
by nshipes on May 01, 2012
We’re excited to announce that yesterday we officially released version 1.1 of the Aeris iOS weather framework with several new features and improvements, including improved map overlay animation, new object loaders and endpoints, new map overlays and customization options for the interactive map. Over the course of the next week or two, we will cover some of the advanced features of the iOS framework in greater depth to help you get the most out of using our toolkit.
New Object Loaders, New Overlays
To align with some of the great new endpoints recently added in our core Aeris API, the following API endpoints now have corresponding object loaders in iOS for you to easily integrate into your applications: countries, sunmoon, moonphases, normals, records, tides, and earthquakes. Refer to the Object Loaders documentation for additional information about the new object loaders and the API endpoints they correspond to.
In addition to providing you quick access to the new API endpoints within the iOS framework, we have also added new interactive map point data overlays for climate records and earthquakes. We’ve also included two new tile overlays to the map: current sea surface temperatures and current chlorophyll. All of these new overlays will automatically appear within your map options menu with the update (as long as your account level has access to them).

This 1.1 update also now displays map options based on your current account level (based on your provided client id/key combination), so if you don’t have access to a certain tile or point data overlay it will no longer appear in your map options view.
Map Customization
With version 1.1, you now have more control over the look and feel of your interactive weather map. You can now provide custom graphics to use for the various point data annotations, set the opacity of any tile overlay and control some of the animation features. You can read more about the types of customization currently supported on our main customization section within the iOS framework docs.
Be sure to review the complete version history for details on the additions, improvements and changes in version 1.1, and refer to each framework’s code documentation (for Aeris, AerisUI and AerisMap) for the public classes available to your applications.
...
Read more...
by nshipes on Feb 03, 2012
This week we have pushed out updates to the Aeris Weather API and the iOS framework. We have also been busy wrapping up development for the initial release of the JavaScript toolkit coming soon.
The Aeris Weather API 1.0.6 update is a maintenance release that fixes several bugs and adds a few improvements. Most notably, updates to the storm cells endpoint and a new sortable date-time mapping for the storm reports, storm cells and fires endpoints. Additionally, a new “skip” parameter (currently in beta) was added which allows skipping over a specific number of results, which is useful when pagination is required. Review the version history for a complete list of changes.
Additions to the Storm Cells Endpoint
The storm cells now include a place object that provides the closest city, state and country to the storm cell. Also, a new ob.location property has been added which provides the distance and bearing to the closest city, such as “3 miles SSW of Mobile”. This better aligns the storm cells endpoint with our standard output for other similar endpoints.
Additionally, new query mappings were added for the name and state of the closest city to the storm cell, which can be used to request all storm cells within a state:
For example, the following query will return up to 100 storm cells in the state of Alabama:
/stormcells/search?query=state:al&limit=100
The following will return up to 100 storm cells in the state of Alabama with a rotation signature:
/stormcells/search?query=state:al&filter=rotating&limit=100
New sort mapping for Storm Reports
We have added two new sort mappings for storm reports: “dt” and “details”. The new “dt” mapping allows sorting results based on the report date and time.
For example, the following query will return up to 50 storm reports in the state of Minnesota, sorted newest to oldest, over the past 7 days:
/stormreports/search?query=state:mn&sort=dt:-1&from=-7days&limit=50
Note: The “dt” mapping was also added to the stormcells and fires endpoints.
The new “details” mapping allows sorting results based on the measured value in the report, when available.
For example, the following would return the top 10 snow reports in Minnesota for the past week sorted by the amount of snow reported in descending order:
/stormreports/search?query=state:mn&sort=detail:-1&filter=snow&from=-7days&limit=10
Skip Parameter
Although this feature is still in beta, we are also introducing the new “skip” parameter. This parameter can be used to skip a specified number of results, which when combined with the “limit” parameter can be useful in paging implementations.
For example, you may want to return 10 of the closest cities to Minneapolis sorted by descending distance but skip the first 10 results:
/places/closest?p=minneapolis,mn&skip=10&limit=10
Aeris iOS Framework Updates
Our 1.0.3 release of the Aeris iOS framework is a maintenance release that fixes several bugs and brings the model properties up to date with the property changes recently made in the core API.
The biggest change resulted from a bug in which the date and times displayed in the sample application were not using the proper time zone of the actual location the data was for, but instead always falling back the time zone of the iOS device. Therefore, we have added a new `timeZone` property that stores an NSTimeZone instance for the time zone of data’s location. This can then be passed to custom date formatters and calendars to get the correct day and time from the stored `timestamp` property (Note that all dates in iOS are stored in GMT). Refer to the developer documentation for the Aeris.framework for the full set of properties supported for each object.
Although new features have not been added in this update, support for batch processing and several new features are in the works will be coming very soon to the iOS framework. Refer to the full version history for the full list of changes in version 1.0.3.
...
Read more...