Baidu Map Jsapi Gl logo

Baidu Map Jsapi Gl

Community
infometa
baidu-map-jsapi-gl

编写、修改、审查或调试百度地图浏览器前端代码时使用,覆盖 BMapGL / JSAPI WebGL 地图初始化、覆盖物、图层、事件、样式、交互和渲染性能。用户要求地图 HTML、前端组件、BMapGL 示例或排查浏览器地图问题时触发;不用于直接回答地点/路线/天气结果、服务端 WebAPI 代码或账户资源管理。

Overview

Publisherinfometa
Repositoryworkbuddyskills
Skill namebaidu-map-jsapi-gl
Stars
376
Forks
124
Bundled files
24
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 24 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by infometa on GitHub. Read the source before you install it.

Installation

Install the Baidu Map Jsapi Gl AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/infometa/workbuddyskills/tree/main/connectors/baidu-maps/skills/baidu-map-jsapi-gl
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/infometa/workbuddyskills.git /tmp/workbuddyskills
mkdir -p .claude/skills
cp -r /tmp/workbuddyskills/connectors/baidu-maps/skills/baidu-map-jsapi-gl .claude/skills/baidu-map-jsapi-gl
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Baidu Map Jsapi Gl in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Baidu Map Jsapi Gl on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Baidu Map Jsapi Gl is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

JSAPI GL 开发指南

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

边界与版本

  • 本 skill 只负责浏览器前端代码。直接获取地点、路线、地址或天气答案时使用 baidu-map(本连接器 MCP 工具);服务端调用代码使用 baidu-map-webapi。
  • 默认使用 BMapGL:加载 https://api.map.baidu.com/api?v=1.0&type=webgl&...,命名空间为 BMapGL。
  • 仅当用户明确要求 JSAPI 3.0,或现有项目已经使用 3.0 时,才沿用 BMapJS。不得在同一实现中混用 BMapGL 与 BMapJS。

AK 来源

本 skill 需要浏览器端 AK:

  1. 优先读取环境变量 BMAP_JSAPI_KEY。
  2. 无值时,按 references/get-ak.md 引导用户在控制台创建浏览器端 AK,不要自行编造或复用服务端 AK。
  3. 需要个性化底图样式时,style_id 只能由用户在开放平台控制台创建后提供,不得猜测。

若用户只要求审查代码、解释 API 或提供不执行的结构示例,且任务不需要真实运行,不要为了填充示例而创建 AK。交付可运行页面时不得写入假 AK 或遮掩后的 AK。

何时适用

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

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

快速参考

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 格式瓦片,支持样式表达式、特征交互、状态管理

6. 路径规划

  • references/route-common.md - 通用配置:构造参数、渲染选项、回调函数、数据结构、状态常量
    • references/driving-route.md - 驾车:策略枚举、途经点、路况、收费、拖拽
    • references/walking-route.md - 步行:转向类型、拖拽
    • references/riding-route.md - 骑行:骑行搜索
    • references/transit-route.md - 公交:市内/跨城策略、交通方式、换乘

7. 其他LBS服务

  • references/local-search.md - 本地检索:普通/范围/周边检索、结果处理、翻页、POI 数据结构
  • references/geocoder.md - 地理编码:正地理编码(地址→坐标)、逆地理编码(坐标→地址)
  • references/convertor.md - 坐标转换:GPS/高德/谷歌坐标转百度坐标

文档使用顺序

  1. 常用且稳定的实现模式先读取上面的本地 references/ 文件。
  2. 本地 reference 未覆盖的精确参数、返回字段、限制、错误码或版本差异,明确告知用户需以百度地图开放平台官方文档为准。不得用未经核实的记忆补齐精确字段。

参考文件路径相对于本 SKILL.md:

references/map-init.md

每个参考文件包含:

  • 功能简要说明
  • 完整代码示例及解释
  • API 参数说明和注意事项

AK 故障排查

  • references/get-ak.md - 当浏览器端 AK 缺失、失效或白名单不匹配时读取

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Baidu Map Jsapi Gl AI skill do?

编写、修改、审查或调试百度地图浏览器前端代码时使用,覆盖 BMapGL / JSAPI WebGL 地图初始化、覆盖物、图层、事件、样式、交互和渲染性能。用户要求地图 HTML、前端组件、BMapGL 示例或排查浏览器地图问题时触发;不用于直接回答地点/路线/天气结果、服务端 WebAPI 代码或账户资源管理。

Why use Baidu Map Jsapi Gl on TypingMind?

Because you install it once and use it with any model. Baidu Map Jsapi Gl is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Baidu Map Jsapi Gl in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/infometa/workbuddyskills/tree/main/connectors/baidu-maps/skills/baidu-map-jsapi-gl. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Baidu Map Jsapi Gl?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Baidu Map Jsapi Gl?

As many as you like. As long as a model supports skills, you can use Baidu Map Jsapi Gl with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Baidu Map Jsapi Gl AI skill free?

Yes. It is published on GitHub by infometa under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇