public class MapView
继承自FrameLayout。显示地图的视图(包含从Huawei地图服务获取的数据)。
无
| Construction Method |
| MapView(Context context) |
| MapView(Context context, AttributeSet attrs) |
| MapView(Context context, AttributeSet attrs, int defStyle) |
| MapView(Context context, HuaweiMapOptions options) |
| Return type | Method name |
| void | getMapAsync(OnMapReadyCallback callback) |
| void | onCreate(Bundle savedInstanceState) |
| void | onDestroy() |
| void | onEnterAmbient(Bundle ambientDetails) |
| void | onExitAmbient() |
| void | onLowMemory() |
| void | onPause() |
| void | onResume() |
| void | onSaveInstanceState(Bundle outState) |
| void | onStart() |
| void | onStop() |
| Method |
| public void getMapAsync(OnMapReadyCallback callback) |
| 开发者调用此API获得一个HuaweiMap对象。 |
Parameters:
| Parameter name | Parameter desc |
| callback | 当HuaweiMap准备就绪时回调。 |
Return:
无
| Method |
| public void onCreate(Bundle savedInstanceState) |
| 地图创建时的生命周期函数,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
| Parameter name | Parameter desc |
| savedInstanceState | 保存的地图状态。 |
Return:
无
| Method |
| public void onDestroy() |
| 地图销毁时的生命周期函数,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无
| Method |
| public void onLowMemory() |
| 内存不足时调用此方法,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无
| Method |
| public void onPause() |
| 活动暂停时调用此方法,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无
| Method |
| public void onResume() |
| 活动准备就绪时调用此方法,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无
| Method |
| public void onSaveInstanceState(Bundle outState) |
| 意外退出,保存数据。 |
| 意外退出时调用此方法保存当前地图状态信息,用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
| Parameter name | Parameter desc |
| outState | 保存地图状态信息。 |
Return:
无
| Method |
| public void onStart() |
| MapView创建成功后调用此方法,地图可见。用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无
| Method |
| public void onStop() |
| 活动退出时调用此方法,界面不可见。用户重载这个方法时必须调用父类的这个方法。 |
Parameters:
无
Return:
无