介绍
本文件旨在作为API中重要且公开类的参考;我们建议查看示例,因为它们将帮助您最快地开始使用MapLibre;
大多数这里描述的类都有一个用于初始化的"Options"对象,建议检查存在哪些选项;
推荐导入您需要的内容并使用它;类的一些示例假设您已经这样做了;例如,像这样导入Map
类:
import {Map} from 'maplibre-gl';
const map = new Map(...)
为简洁起见,示例中省略了导入声明;
主要部分
标记和控件
- AttributionControl
- FullscreenControl
- GeolocateControl
- GlobeControl
- Hash
- LogoControl
- Marker
- NavigationControl
- Popup
- ScaleControl
- TerrainControl
地理和几何
处理器
- BoxZoomHandler
- CooperativeGesturesHandler
- DoubleClickZoomHandler
- DragPanHandler
- DragRotateHandler
- KeyboardHandler
- ScrollZoomHandler
- TwoFingersTouchPitchHandler
- TwoFingersTouchRotateHandler
- TwoFingersTouchZoomHandler
- TwoFingersTouchZoomRotateHandler
数据源
- CanvasSource
- GeoJSONSource
- ImageSource
- RasterDEMTileSource
- RasterTileSource
- VectorTileSource
- VideoSource
- Source