public static interface

AmazonMap.InfoWindowAdapter

com.amazon.geo.mapsv2.AmazonMap.InfoWindowAdapter

Class Overview

Interface for displaying Marker info windows. The map displays info windows when the user clicks a marker or when you call showInfoWindow(). Only one info window is displayed at a time, so the adapter can reuse previously created views or it can create a new view each time an info window is displayed.

To replace the entire info window, return a View in getInfoWindow(Marker) and return null in getInfoContents(Marker). To replace just the contents of the info window but use the default frame, return a View in getInfoContents(Marker) and return null in getInfoWindow(Marker)

When the map needs to display an info window, getInfoWindow(Marker) is called first. If this method returns a View, the View is used and getInfoContents(Marker) is never called. If the method returns null, then getInfoContents(Marker) is called. If this method returns a View, the View used as the contents of the info window by wrapping it in the default info window frame. If both methods return null, the default info window is used. The default info window displays the Marker's title and snippet.

Note that the views returned by each method are not live views, so updates to the views after they are returned are not reflected on the map. Instead, the view is rendered as an image to be displayed as an overlay on the map. This also means that the view will not receive events such as clicks. To update the view after it has been displayed, call showInfoWindow(). To be notified when an info window is clicked, use setOnInfoWindowClickListener(OnInfoWindowClickListener).

Summary

Public Methods
abstract View getInfoContents(Marker marker)
Gets a View representing the contents to display inside of the default info window frame.
abstract View getInfoWindow(Marker marker)
Gets a View representing the entire info window for a Marker.

Public Methods

public abstract View getInfoContents (Marker marker)

Gets a View representing the contents to display inside of the default info window frame. This method is only called if getInfoWindow(Marker) returns null.

If this method returns null the default info window is used.

Parameters
marker The Marker for which the info window is displayed.
Returns
  • A custom View to display within the default info window frame for the Marker. Return null to use the default info window.

public abstract View getInfoWindow (Marker marker)

Gets a View representing the entire info window for a Marker. If this method returns null getInfoContents(Marker) is called.

Parameters
marker The Marker for which the info window is displayed.
Returns
  • A custom View to display for the Marker. The (@code View} needs to provide the complete window. Return null to use the default frame with custom contents from getInfoContents(Marker).