public final class MapEngine
extends java.lang.Object
MapEngine
manages all mapping resources and services provided in this SDK.
MapEngine
must be initialized before any of the services can be used. For more
information, see init(Context, OnEngineInitListener)
.
Users can maintain reference count through the use of onPause()
and onResume()
thus control when to relinquish MapEngine
services.
Modifier and Type | Method and Description |
---|---|
static MapEngine |
getInstance()
Returns the MapEngine singleton, if one has already been created.
|
void |
init(android.content.Context context,
OnEngineInitListener listener)
Asynchronously initialize the
MapEngine . |
void |
onPause()
Decrements the reference count of map resource usage.
|
void |
onResume()
Increments the reference count of map resource usage.
|
public static MapEngine getInstance()
Once the MapEngine
instance is available, it must be initialized through one of the
following methods before it can be used:
MapEngine
instancepublic void init(android.content.Context context, OnEngineInitListener listener)
MapEngine
. MapEngine
cannot be used until it
has been initialized successfully.
This method is particularly useful for users of headless APIs as the MapEngine
is
being automatically initialized as part of the setup process of MapFragment
s orcontext
- context to be used during initialization.listener
- OnEngineInitListener
to provide information when MapEngine
initialization completes and if it has been successful.MapFragment.init(OnEngineInitListener)
,
MapFragment.init(Context, OnEngineInitListener)
public void onPause()
onPause
.
For users of MapFragment
class, it is not necessary to
call onPause()
as it is handled automatically.
public void onResume()
onResume
.
For users of MapFragment
class, it is not necessary to
call onResume()
as it is handled automatically.