| java.lang.Object | ||
| ↳ | android.app.Fragment | |
| ↳ | com.amazon.geo.mapsv2.MapFragment | |
Represents a Fragment for displaying a map.
Use this class if your app targets android API 12 and above.
Otherwise, use SupportMapFragment.
Because this class is Fragment, it encompasses
the View of a map and manages its life cycle.
If useViewLifecycleInFragment(boolean) flag is
true, the MapFragment is invalid when it is detached from the
Activity, such as after calling the onDestroyView() method.
The MapFragment is usable after it is re-attached and
onCreateView(LayoutInflater, ViewGroup, Bundle) is called.
Typically you add a MapFragment in the layout XML. For example:
<fragment android:id="@+id/mapfragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.amazon.geo.mapsv2.MapFragment" />
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.content.ComponentCallbacks2
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Public default constructor.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Use
getMapAsync(OnMapReadyCallback) instead. The
callback of that method provides an AmazonMap
which is guaranteed to be non-null.
| |||||||||||
Get an
AmazonMap asynchronously with a callback after it is ready
to be used. | |||||||||||
Creates a new
MapFragment object with the specified map options. | |||||||||||
Creates a new
MapFragment object with default options. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.app.Fragment
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.content.ComponentCallbacks
| |||||||||||
From interface
android.content.ComponentCallbacks2
| |||||||||||
From interface
android.view.View.OnCreateContextMenuListener
| |||||||||||
Public default constructor. Use newInstance() or
newInstance(AmazonMapOptions) to create a MapFragment
dynamically.
This method is deprecated.
Use getMapAsync(OnMapReadyCallback) instead. The
callback of that method provides an AmazonMap
which is guaranteed to be non-null.
Gets the map object associated with this MapFragment.
This method returns null if the map is not yet initialized
through onCreateView(LayoutInflater, ViewGroup, Bundle). Subsequent calls can return a valid
AmazonMap object once the map is initialized.
This method also returns null if the Amazon Maps API
library is not available on the device.
AmazonMap object. Returns null if the map
has not been initialized or if the Amazon Maps API library
is not available on the device.Get an AmazonMap asynchronously with a callback after it is ready
to be used. The map provided to the callback is guaranteed to be
non-null.
This method must be called from the main thread. The callback will be invoked on the main thread.
| callback | The callback to invoke when the map is ready to use. |
|---|
Creates a new MapFragment object with the specified map options.
| options | An AmazonMapOptions object with the desired initial map options. |
|---|
MapFragment} object.
Creates a new MapFragment object with default options.
MapFragment object.