Weather Maps

The weather map feature requires you to include the com.aerisweather.aeris.maps.AerisMapViewContainer in your layout XML where you would like the map to appear. The map includes support for AerisWeather Maps layers (radar, satellite, etc).  Point data (storm cells, storm reports) and Polygon data (convective, drought, fire). There are also features to to allow animation of these overlays and more.

Creating a Weather Map

To begin, we need to add the com.aerisweather.aeris.maps.AerisMapContainerView to your layout XML.





The AerisWeather MapContainerView contains a reference to the AerisWeather MapView class, which is derived from GoogleMapView. This will be the main class used to access your weather map, as well as the AnimationView used to draw the images used for animating the map.

Initializing Your Map

In order to initialize the map and the various overlay controlls and settings you will need to import the AerisWeather MapView within your code. Notice too that we must implement the OnMapReadyCallback function. This is how GoogleMaps tells us that the map is ready for us to work with.

package com.example.fragment

public class MyMapFragment extends Fragment implements
        OnAerisMapLongClickListener, AerisCallback, ObservationsTaskCallback,
        OnAerisMarkerInfoWindowClickListener, RefreshInterface, OnMapReadyCallback

    private LocationHelper m_locHelper;
    private Marker m_marker;
    private TemperatureWindowAdapter m_infoAdapter;
    private static final int REQUEST_PERMISSIONS = 0;
    LayoutInflater m_inflater;
    ViewGroup m_container;
    Bundle m_savedInstanceState;
    GoogleMap m_googleMap;
    protected AerisMapView m_aerisMapView;
    private AerisMapOptions m_mapOptions = null;
    private AerisAmp m_aerisAmp;
    private boolean m_isMapReady = false;
    private boolean m_isAmpReady = false;

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        m_inflater = inflater;
        m_container = container;
        m_savedInstanceState = savedInstanceState;

        View view = inflater.inflate(R.layout.fragment_interactive_maps, container, false);
        AerisMapContainerView mapContainer = (AerisMapContainerView) view.findViewById(;
        m_aerisMapView = mapContainer.getAerisMapView();

        //create an instance of the AerisAMP class
        m_aerisAmp = new AerisAmp(getString(R.string.aerisapi_client_id), getString(R.string.aerisapi_client_secret));

        //start the task to get the AMP layers
            //get all the possible layers, then get permissions from the API and generate a list of permissible layers

            new AerisAmpGetLayersTask(new GetLayersTaskCallback(), m_aerisAmp).execute().get();
        catch (Exception ex)
            String s = ex.getMessage();

            //if the task fails, keep going without AMP layers
        return view;


When the map is ready, our callback is fired and we can continue with initializing the map as needed.

    public void onMapReady(GoogleMap googleMap)
        m_isMapReady = true;
        m_googleMap = googleMap;
        if (m_isAmpReady)

Using Layers

AerisWeather Android maps can be customized with many different layers, even more so with the addition of the AerisWeather Maps


Point and Polygon Data

To add a point or polygon layer to the map, we call the addLayer method on the AerisMapView instance, such as:

//point data - show the storm reports from the past 24 hours


or retrieve the layers from the device's saved preferences:

//saved point data

//saved polygons 

To remove point and polygon layers from your map:

// remove point data layer
// remove point data layer


AerisWeather Maps Layers

Displaying AerisWeather Maps weather layers on your map can be achieved in a few different ways.

Create an AerisWeather AMPLayer object for each desired AMP layer, and add them to the parent AerisWeather AMP object.

AerisAmpLayer aerisAmpLayer = new AerisAmpLayer(); //creates a radar layer by default

or simply passing in the name or id of an existing AMP layer:

//add the radar layer

//add the satellite layer

or we can just set the default layers:

//set default layers/data

To remove an AMP layer simply get the AerisWeather AmpLayer from the AerisAmp object's active layer list and pass that layer to the removeAmpLayer(AerisAmpLayer) method.

ArrayList layers = aerisAmp.getActiveMapLayers();
for (AerisAmpLayer layer: layers)
    if (layer.getLayerId() == "sat")

Last modified: July 27, 2021