目录

TextureMapView

Class Info

public class TextureMapView extends MapView

Map container, which is inherited from MapView.

CAUTION:

TextureMapView cannot be used together with MapFragment, MapView, and SupportMapFragment.

Public Constructor Summary

If the input parameter is not of the Activity type, no update wizard will be displayed to a user when HMS Core (APK) needs to be updated. Instead, the error information "Hms is not available26" is displayed. In such case, HMS Core (APK) needs to be manually updated. To show the update wizard, you are advised to pass a parameter of the Activity type instead of the Context type to create a TextureMapView instance.

Constructor Name

TextureMapView(Context context)

Creates a TextureMapView object based on specified parameters.

TextureMapView(Context context, AttributeSet attrs)

Creates a TextureMapView object based on specified parameters.

TextureMapView(Context context, AttributeSet attrs, int defStyle)

Creates a TextureMapView object based on specified parameters.

TextureMapView(Context context, HuaweiMapOptions options)

Creates a TextureMapView object based on specified parameters.

Public Method Summary

Qualifier and Type

Method Name and Description

void

getMapAsync(OnMapReadyCallback callback)

Obtains a HuaweiMap object when the object is ready.

void

onCreate(Bundle savedInstanceState)

Called when a map is created.

void

onDestroy()

Called when a map is destroyed.

void

onLowMemory()

Called when the memory is insufficient.

void

onPause()

Called when an activity is paused.

void

onResume()

Called when an activity is ready.

void

onSaveInstanceState(Bundle outState)

Called to save the current map status upon unexpected exit.

void

onStart()

Called when an activity is created successfully. Then the map is visible.

void

onStop()

Called when an activity exits. Then the map is invisible.

Methods Inherited from Class com.huawei.hms.maps.MapView

getMapAsync(OnMapReadyCallback callback), onCreate(Bundle savedInstanceState), onDestroy(), onLowMemory(), onPause(), onResume(), onSaveInstanceState(Bundle outState), onStart(), onStop()

Public Constructors

[h2]TextureMapView(Context context)

Constructor

public TextureMapView(Context context)

Creates a TextureMapView object based on specified parameters.

Parameters

Name

Description

context

Context.

[h2]TextureMapView(Context context, AttributeSet attrs)

Constructor

public TextureMapView(Context context, AttributeSet attrs)

Creates a TextureMapView object based on specified parameters.

Parameters

Name

Description

context

Context.

attrs

Collection of MapView attributes in the XML file.

[h2]TextureMapView(Context context, AttributeSet attrs, int defStyle)

Constructor

public TextureMapView(Context context, AttributeSet attrs, int defStyle)

Creates a TextureMapView object based on specified parameters.

Parameters

Name

Description

context

Context.

attrs

Collection of MapView attributes in the XML file.

defStyle

Attributes of the current theme, including reference to the style resource. The resource provides default values for the map view. The value 0 indicates that default values are not used.

[h2]TextureMapView(Context context, HuaweiMapOptions options)

Constructor

public TextureMapView(Context context, HuaweiMapOptions options)

Creates a TextureMapView object based on specified parameters.

Parameters

Name

Description

context

Context.

options

TextureMapView instance that contains configurations about the map.

Public Methods

[h2]getMapAsync

Method

public void getMapAsync(OnMapReadyCallback callback)

Obtains a HuaweiMap object when the object is ready.

Parameters

Name

Description

callback

Callback to be executed when a HuaweiMap object is ready for use.

[h2]onCreate

Method

public void onCreate(Bundle savedInstanceState)

Called when a map is created. If this method needs to be reloaded, call it from the parent class.

Parameters

Name

Description

savedInstanceState

Map status to be saved.

[h2]onDestroy

Method

public void onDestroy()

Called when a map is destroyed. If this method needs to be reloaded, call it from the parent class.

[h2]onLowMemory

Method

public void onLowMemory()

Called when the memory is insufficient. If this method needs to be reloaded, call it from the parent class.

[h2]onPause

Method

public void onPause()

Called when an activity is paused. If this method needs to be reloaded, call it from the parent class.

[h2]onResume

Method

public void onResume()

Called when an activity is ready. If this method needs to be reloaded, call it from the parent class.

[h2]onSaveInstanceState

Method

public void onSaveInstanceState(Bundle outState)

Called to save map data upon unexpected exit.

If this method needs to be reloaded, call it from the parent class.

Parameters

Name

Description

outState

Map data to be saved.

[h2]onStart

Method

public void onStart()

Called when an activity is created successfully. Then the map is visible. If this method needs to be reloaded, call it from the parent class.

[h2]onStop

Method

public void onStop()

Called when an activity exits. Then the map is invisible. If this method needs to be reloaded, call it from the parent class.