更新时间:2026/07/27 10:37
您当前查看的是 JSAPI GL 历史版本文档。该版本仅用于维护现有项目,不建议用于新项目开发。新项目请使用 JSAPI 4.0,如需升级现有项目,请参考升级指南。
You are viewing the legacy JSAPI GL documentation. This version is maintained for existing projects only and is not recommended for new development. For new projects, use the JSAPI 4.0 documentation. If you are upgrading an existing project, please refer to the Migration Guide.
You are viewing the legacy JSAPI GL documentation. This version is maintained for existing projects only and is not recommended for new development. For new projects, use the JSAPI 4.0 documentation. If you are upgrading an existing project, please refer to the Migration Guide.
简易行政区划图层
简介
DistrictLayer图层,支持以jsapi方式获取的新版行政区划数据,并进行行政区划图层展示。
该行政区划图层支持多级行政区划的数据获取与展示,并提供了行政区合并为大区的特色功能。
DistrictLayer类参考
构造函数:
参数说明:
options属性变量:
方法:
使用示例
- 1创建地图参照展示地图
- 2创建行政区划聚合图层,并添加到地图上
创建行政区划图层类,其继承自Overlay,通过map.addoverlay()方法将创建的点覆盖物添加到地图上。
JavaScriptvar dist = new BMapGL.DistrictLayer({name: '(北京,天津,河北省)',fillColor: '#5e8bff',fillOpacity: 1,});map.addDistrictLayer(dist);
本篇文章对您是否有帮助?