# MapContext.eraseLines(Object object)

> 基础库 2.5.0 开始支持，低版本需做[兼容处理](1003706)。

> __以 [Promise 风格](/miniprogram/dev/framework/app-service/api.md#异步-API-返回-Promise) 调用__：不支持
> 
> __小程序插件__：支持
> 
> __微信 鸿蒙 OS 版__：支持

> 相关文档: [map](https://developers.weixin.qq.com/miniprogram/dev/component/map.html)

## 功能描述

擦除或置灰已添加到地图中的线段。

## 参数

### Object object


```json
[
  {
    "属性": "lines",
    "类型": "Array.<Object>",
    "默认值": "",
    "必填": "是",
    "说明": "要擦除的线段数组。详见 [polyline 属性](https://developers.weixin.qq.com/miniprogram/dev/component/map.html#polyline)。",
    "子项": [
      {
        "结构属性": "id",
        "类型": "number",
        "默认值": "",
        "必填": "是",
        "说明": "线段的 id。"
      },
      {
        "结构属性": "index",
        "类型": "number",
        "默认值": "",
        "必填": "是",
        "说明": "指定线段的某一段，线段起点 index 为 0"
      },
      {
        "结构属性": "point",
        "类型": "Object",
        "默认值": "",
        "必填": "是",
        "说明": "指定线段某一段中的点",
        "子项": [
          {
            "结构属性": "longitude",
            "类型": "number",
            "默认值": "",
            "必填": "是",
            "说明": "经度"
          },
          {
            "结构属性": "latitude",
            "类型": "number",
            "默认值": "",
            "必填": "是",
            "说明": "纬度"
          }
        ]
      },
      {
        "结构属性": "clear",
        "类型": "boolean",
        "默认值": "true",
        "必填": "否",
        "说明": "为 true 时擦除，false 时置灰"
      }
    ]
  },
  {
    "属性": "success",
    "类型": "function",
    "默认值": "",
    "必填": "否",
    "说明": "接口调用成功的回调函数"
  },
  {
    "属性": "fail",
    "类型": "function",
    "默认值": "",
    "必填": "否",
    "说明": "接口调用失败的回调函数"
  },
  {
    "属性": "complete",
    "类型": "function",
    "默认值": "",
    "必填": "否",
    "说明": "接口调用结束的回调函数（调用成功、失败都会执行）"
  }
]
```
