# OL 透传能力

## 可直接使用的 OL API

通过 `map.map` 使用 OpenLayers，文档见 [OL API](https://openlayers.org/en/latest/apidoc/)。

### 常用

```js
const olMap = map.map;
const view = olMap.getView();

view.animate({ zoom: 14, duration: 300 });
olMap.once('rendercomplete', () => {});
olMap.getCoordinateFromPixel([100, 200]);
olMap.updateSize(); // 容器从 hidden→显示后调用
```

| API | 说明 |
|-----|------|
| `getView()` | 视图 |
| `on` / `un` / `once` | 事件 |
| `addLayer` / `removeLayer` / `getLayers` | 图层集合 |
| `getSize` / `getCoordinateFromPixel` / `getPixelFromCoordinate` | 坐标换算 |
| `dispose` | 销毁（业务请优先 `map.destroy()`） |

图层上：`setVisible`、`getSource`、`setOpacity`、`set` / `get`。  
Source 上：`updateParams`、`clear`、`addFeature`、`getFeatureById`。

### 融合注意

1. 不要覆盖 `map.map.business`。
2. 业务显隐优先 `displayLayer` / `showLayers`，避免 WMS `LAYERS` 与字典不同步。
3. `Overlay.setVisible` 已被扩展。
4. Draw / WriteServer 等已是 Layer，请用其自定义方法管理 interaction。

---
