Blog

Updates, examples and tips from the inside.

Aeris iOS Weather Framework 1.1.5 Released

by nshipes on Oct 26, 2012

An update to our iOS weather framework is now available that includes several bug fixes and a few new features. As always, review the 1.1.5 complete release notes for more detailed information on the latest changes and fixes.

Dynamic Opacity and Speed
The biggest addition to the framework comes in the interactive map feature. We’ve had several requests to add support for dynamically adjusting an image overlay’s opacity and animation speed at runtime. Well, we listened to your feedback, and it’s finally here! 

Overlay Options

To take advantage of this new feature immediately, we have already added default controls for map overlay opacity and animation speed under the map options (as pictured above). This is built into AFWeatherMapOptionsViewController, so you don’t have to do anything if your applications are already using this class to display the map’s overlay options.

If you aren’t using our included AFWeatherMapOptionsViewController in your own custom applications, but want to use this new feature, adding support for it is simple. In the case above, we are using two instances of UIKit’s UISlider component and hooking them up to action handlers to adjust the opacity/speed when the slider values change:


// hook up the action handlers to the UIControlEventValueChanged event
...
[alphaSlider addTarget:self action:@selector(alphaSliderAction:) forControlEvents:UIControlEventValueChanged];
[animationSlider addTarget:self action:@selector(animationSliderAction:) forControlEvents:UIControlEventValueChanged];
...

// adjust opacity and speed on AFWeatherMap when UISlider values change
- (void)alphaSliderAction:(UIControl *)control {
	CGFloat val = ((UISlider *)control).value;
	val = roundf(val * 10) / 10;
	self.weatherMap.overlayAlpha = val;
}

- (void)animationSliderAction:(UIControl *)control {
	CGFloat val = ((UISlider *)control).value;
	val = roundf(val * 10) / 10;
	// need to reverse value back since a lower number is faster
	self.weatherMap.animationSpeed = 1.1 - val;
}

Another thing to take note of with this addition is that we have removed the opacity setting for each individual image overlay in favor of a single global default opacity value. This value is used as the initial opacity for all image overlays displayed on the map before any adjustments are made using the new opacity and animation speed settings above. You can find these settings in your AerisMapConfig.plist file within the AerisMap.embeddedframework/Resources directory. Refer to the complete description of each map setting for more information.

Customizing Point and Polygon Overlays
You now have more control over what type of data is displayed for all point and polygon data overlays. We have added an additional property, OptionsString, for each of these overlays in your AerisMapConfig.plist file that allows you to provide your own Aeris API options to use for each of the data requests for that overlay. The value for this setting is just a normal API query string you would use when making the API calls from the browser or another script.

We are building our iOS roadmap in more detail for our upcoming bigger 1.2 release which we will provide details on in an upcoming blog entry and are definitely excited about. If you would like to see certain features in a future update to our iOS framework, feel free to let us know via Twitter (@hwaeris or our contact form.

posted in General

Submit a comment

Commenting is not available in this channel entry.

Comments

  • There are no comments for this entry.

Archive