This is a comprehensive reference guide for Baidu Maps' WebGL JavaScript API (BMapGL), covering everything from basic map initialization to advanced features like custom overlays, MVT vector tiles, and route planning. You'll find detailed docs on markers, polylines, polygons, event handling, map styling, and third party layer integration. It includes code examples and API references organized into logical modules, plus coordinate conversion utilities for GPS and other mapping systems. The guide assumes you have a Baidu Maps API key and are building web based mapping applications that need 3D rendering capabilities. If you're working with Baidu's mapping platform or need to migrate from their older 2D API, this gives you the complete picture in one place.

skills.sh installs
342
GitHub stars
46
last updated
Aug 21, 2026

Install

$ npx -y skills add baidu-maps/jsapi-skills --skill bmap-jsapi-gl --agent claude-code

Installs into .claude/skills of the current project.

Files

JSAPI GL 开发指南

百度地图 JSAPI WebGL 版本开发指南。包含地图初始化、覆盖物、事件、图层等核心模块的 API 说明和代码示例,旨在帮助开发者快速集成百度地图并遵循正确的使用方式。

何时适用

在以下场景中参考这些指南:

  • 创建新的地图页面或组件
  • 在地图上添加标注、折线、多边形等覆盖物
  • 处理地图交互事件(点击、拖拽、缩放等)
  • 配置地图样式或切换图层
  • 调试地图渲染或性能问题

快速参考

0. 基础概念

  • references/base-classes.md - 基础类:Point、Bounds、Size、Pixel、Icon
  • references/constants.md - 通用常量:搜索状态码、POI 类型

1. 地图

  • references/map-init.md - 地图初始化:资源引入、创建实例、配置选项、交互与视图控制

2. 地图覆盖物

  • references/overlay-common.md - 覆盖物通用操作:添加/移除、显示/隐藏、批量清除
  • references/marker.md - 点标记:构造参数、位置/图标/旋转/置顶/拖拽方法
  • references/polyline.md - 折线:构造参数、线条样式、坐标操作、编辑模式
  • references/polygon.md - 多边形:构造参数、边框/填充样式、带孔多边形、编辑模式
  • references/circle.md - 圆形:构造参数、中心点/半径、样式设置、编辑模式
  • references/custom-overlay.md - 自定义覆盖物:DOM 创建、属性传递、事件绑定、旋转控制
  • references/info-window.md - 信息窗口:构造参数、内容/尺寸设置、最大化、与 Marker 配合使用

3. 事件

  • references/map-events.md - 地图事件:绑定方式、交互事件、视图变化事件、生命周期事件
  • references/overlay-events.md - 覆盖物事件:通用事件、拖拽事件、矢量图形事件

4. 地图样式

  • references/map-style.md - 个性化地图:自定义地图外观(颜色、显隐),实现深色主题、简洁地图等效果

5. 图层服务

  • references/xyz-layer.md - 第三方图层:加载 XYZ/TMS/WMS/WMTS 标准瓦片
  • references/mvt-layer.md - 矢量瓦片:加载 MVT/PBF 格式瓦片,支持样式表达式、特征交互、状态管理

Sponsors

Details

Repository
github.com/baidu-maps/jsapi-skills
First seen
Jun 3, 2026

More from baidu-maps/jsapi-skills

All 2

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs