Google Maps SDK Support

The Aeris Weather SDK for iOS fully supports the Google Maps SDK for use with your weather maps if your application uses Google Maps for its mapping library instead of Apple's MapKit.

The Aeris Weather SDK abstracts away much of the interactions with the Mapbox SDK and other mapping libraries, so it's easy to change the library type just by using the appropriate AWFWeatherMapType value when initializing your weather map instance. While much of the functionality is the same or very similar across all mapping libraries, there may be some differences due to limitations with a particular mapping library.

Adding Google Maps SDK Support

In order to use the Google Maps SDK with your weather maps, you will need to follow a similar process to that when initially installing the Aeris Weather SDK into your project using one of the following methods:

CocoaPods

  1. Add the AerisWeather/Google pod to your Podfile alongside the other . This will add the base AerisGoogleMapKit.framework and its core dependencies to your project, including the latest Google Maps SDK for iOS.

    pod 'AerisWeather/Google'
  2. Run pod install from the Terminal at the root of your project where your Podfile is located.

Carthage

Since the core GoogleMaps SDK for iOS is not built as a dynamic framework, our AerisGoogleMapKit.framework library is not currently offered as a dynamic framework as with other components of the iOS SDK. Therefore, you will need to install AerisGoogleMapKit component of the SDK using the manual instructions below when using Carthage.

Manual

  1. Download the SDK from our Github repository that also contains our demo application. The repo will contain a compressed file archive for you to download.
  2. With your project open in Xcode, select your Target. Under the General tab, find Embedded Binaries and then click the + button.
  3. Click the Add Other... button, navigate to the Aeris Weather SDK files that were downloaded and select AerisGoogleMapKit.framework. Make sure to check the Destination: Copy items if needed checkbox when prompted.
  4. Install the Google Maps SDK for iOS using the manual instructions in their manual installation guide.

Once you have the AerisGoogleMapKit module installed in your project, just create your weather map instance specifying Google as the map type:

self.weatherMap = [[AWFWeatherMap alloc] initWithMapType:AWFWeatherMapTypeGoogle];
weatherMap = AWFWeatherMap(mapType: .google)

Receiving GMSMapViewDelegate Events

When using the Google Maps SDK with a weather map, the weather map and its internal objects must remain the sole delegate on the associated GMSMapView instance. Therefore, you should NOT assign the delegate method on your map view which will break the core weather map functionality.

Instead, just assign the mapViewDelegate property on your AWFWeatherMap instance to the object that should receive GMSMapViewDelegate messages. These messages will get forwarded to the object assigned to this property by the weather map:

self.weatherMap.mapViewDelegate = self;
weatherMap.mapViewDelegate = self

Known Limitations

Using mapping libraries other than Apple's MapKit may introduce limitations in what features or options are available for the third-party library. Currently, there are no known limitations when using the Google Maps SDK for iOS.