---
name: "getMapList"
mode: "kit"
versionRequirements:
  - { name: "MapKit", version: "2.1.0" }
platform:
  - "iOS"
  - "Android"
async: true
title: "ty.map.getMapList"
---

## getMapList

> [VERSION] MapKit >= 2.1.0

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get third-party map types that can be opened

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `complete` | `() => void` | No | - | Callback invoked when the API call completes (runs on both success and failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | Callback invoked on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | Callback invoked on failed API call |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `maps` | `string[]` | `3.0.5` | Supported map providers; currently supported: BMK: Baidu Maps, MA: AMap, TENCENT: Tencent Maps, Google: Google Maps |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extensions |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error information |


### Examples

```tsx
ty.map.getMapList({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
