AI 地图
产品服务
解决方案
文档与支持
定价
更新时间: 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.
ParkingSpot图层
简介

JSAPI GL提供智能停车位高级服务,通过实例化ParkingSpot类,在地图上叠加智能停车位图层,可以实时显示室内/室外停车位的状态、车位区剩余数据等信息。
注意:
智能停车位为高级服务,如果需要使用该服务请联系我们开通高级服务权限。

类参考

详见类参考

使用示例

使用智能停车位可以直接通过实例化ParkingSpot类,通过map的addParkingSpot方法添加到地图上,并可以通过callback属性通过点击获取相应车位信息。
请注意:使用该功能需要在jsapi库之前引入<script src="https://bj.bcebos.com/v1/mapopen-pub-jsapigl/assets/npm/Pako.js"></script>
示例代码

let parking = new BMapGL.ParkingSpot({
callback: function(res) {
const spotname = document.querySelector('#spot-name');
spotname.innerHTML = res.properties.name;
const state = document.querySelector('#spot-state');
state.innerHTML = res.state;
}
});
map.addParkingSpot(parking);

该功能为高级服务,室外停车位的权限为城市级别,室内停车位的权限为建筑级别。

上一篇

全景图

下一篇

点聚合
本篇文章对您是否有帮助?