---
name: "MapContext.removeMarkers"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "MapContext.removeMarkers - 移除 marker"
---

## MapContext.removeMarkers

> [VERSION] Base Library >= 2.21.8

### Description

Remove marker

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `option` | `RemoveMarkersOption` | Yes | Marker id list options |

### Return Value

None


### Referenced Types

##### `interface` RemoveMarkersOption

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `markerIds` | `number[]` | Yes | List of marker IDs to remove |
| `success` | `() => void` | No | Callback invoked on successful API call |
| `fail` | `(result: MapFailResult) => void` | No | Callback on failure |
| `complete` | `() => void` | No | Callback on complete (success or failure) |

##### `interface` MapFailResult

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `errorCode` | `string` | Yes | Error code |
| `errorMsg` | `string` | Yes | Error message |


### Examples

#### Remove marker

```ts
const mapCtx = ty.createMapContext('myMap');
mapCtx.removeMarkers({
  markerIds: [1, 2, 3],
  success() {
    console.log('Markers removed');
  },
});
```
