
Amap Lbs Skill
Wire Amap (Gaode) POI search, routing, trip planning, and heatmap visualization into a Node-backed agent or app using the Web Service API key.
Overview
amap-lbs-skill is an agent skill for the Build phase that integrates Gaode Amap POI search, routing, travel planning, and heatmap visualization via the Web Service API.
Install
npx skills add https://github.com/amap-web/amap-lbs-skill --skill amap-lbs-skillWhat is this skill?
- POI keyword and city-scoped search plus radius-based nearby search
- Route planning for walking, driving, cycling, and transit
- Intelligent travel-itinerary planning and map visualization link generation
- Heatmap data visualization scenario for geographic datasets
- Six documented intent scenarios with local key persistence and env var AMAP_WEBSERVICE_KEY
- 6 user-intent scenarios (keyword search, nearby, heatmap, POI API, routing, travel planning)
- Skill version 2.0.0 in frontmatter
Adoption & trust: 1 installs on skills.sh; 70 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your agent or app needs China-ready map search and routing but you do not want to manually route every user phrase to the correct Amap API scenario.
Who is it for?
Indie apps and agents serving Chinese locales that need POI, 周边搜索, or 路线规划 through a keyed webservice integration.
Skip if: Global Google Maps workflows, offline-only maps, or teams without a Gaode developer key and Node runtime.
When should I use this skill?
User wants to search places, find nearby POI, plan routes or trips, or visualize geo data with Amap—including 搜/找/查/附近/周边/路线/规划 triggers.
What do I get? / Deliverables
User location intents resolve to the right Amap workflow—search, nearby POI, routes, trips, or heatmaps—with key handling and visualization links.
- Amap search or visualization URLs and API-driven location results
- Route or travel plan output for user-specified origin/destination
- Heatmap-oriented geographic presentation when requested
Recommended Skills
Journey fit
Map LBS calls are integration work during product build when you connect user-facing location features to a third-party webservice. The skill centers on Amap Web Service Key, axios/Node, and six user-intent scenarios—not frontend polish alone or launch SEO.
How it compares
Opinionated Amap Web Service orchestration skill, not a generic REST MCP or frontend map widget library.
Common Questions / FAQ
Who is amap-lbs-skill for?
Developers and agent users building location features for China using Gaode LBS with Node and an API key.
When should I use amap-lbs-skill?
During Build/integrations when implementing search, nearby POI, routing, travel plans, or heatmaps from natural-language user requests.
Is amap-lbs-skill safe to install?
It requires a webservice key and network calls to Amap; review the Security Audits panel on this page and rotate keys if the skill package is untrusted.
SKILL.md
READMESKILL.md - Amap Lbs Skill
# 高德地图综合服务 Skill 高德地图综合服务向开发者提供完整的地图数据服务,包括地点搜索、路径规划、旅游规划和数据可视化等功能。 ## 功能特性 - 🔍 POI(地点)搜索功能 - 🏙️ 支持关键词搜索、城市限定、类型筛选 - 📍 支持周边搜索(基于坐标和半径) - 🛣️ 路径规划(步行、驾车、骑行、公交) - 🗺️ 智能旅游规划助手 - 🔥 热力图数据可视化 - 🔗 地图可视化链接生成 - 💾 配置本地持久化存储 - 🎯 自动管理高德 Web Service Key ## 首次配置 首次使用时需要配置高德 Web Service Key: 1. 访问 [高德开放平台](https://lbs.amap.com/api/webservice/create-project-and-key) 创建应用并获取 Key 2. 设置环境变量:`export AMAP_WEBSERVICE_KEY=your_key` 3. 或运行时自动提示输入并保存到本地配置文件 当用户想要搜索地址、地点、周边信息(如美食、酒店、景点等)、规划路线或可视化数据时,使用此 skill。 ## 触发条件 用户表达了以下意图之一: - 搜索某类地点或某个确定地点(如"搜美食"、"找酒店"、"天安门在哪") - 基于某个位置搜索周边(如"西直门周边美食"、"北京南站附近酒店") - 规划路线(如"从天安门到故宫怎么走"、"规划驾车路线") - 旅游规划(如"帮我规划北京一日游"、"杭州西湖游览路线") - 包含"搜"、"找"、"查"、"附近"、"周边"、"路线"、"规划"等关键词 - 希望将地理数据可视化为热力图(如"生成热力图"、"用这份数据做热力图展示") ## 场景判断 收到用户请求后,先判断属于哪个场景: - **场景一**:用户搜索一个**明确的类别**(美食、酒店)或**确定的地点**(天安门、西湖),没有指定"在哪个位置附近" - **场景二**:用户搜索**某个位置周边**的某类地点,输入中同时包含「位置」和「搜索类别」两个要素(如"西直门周边美食"、"北京南站附近酒店") - **场景三**:热力图数据可视化 - **场景四**:POI 详细搜索(使用 Web 服务 API) - **场景五**:路径规划 - **场景六**:智能旅游规划 --- ## 场景一:明确关键词搜索 直接搜索一个类别或地点,不涉及特定位置的周边搜索。 **URL 格式:** ``` https://www.amap.com/search?query={关键词} ``` - **域名**:`www.amap.com` - **路由**:`/search` - **参数**:`query` = 搜索关键词 ### 执行步骤 1. **发送埋点统计请求**:在执行操作前,发送以下请求进行埋点统计: ```bash curl -s "https://restapi.amap.com/v3/log/init?eventId=skill.call&product=skill_openclaw&platform=JS&label=keyword-search&value=call" 2. **提取关键词**:从用户输入中识别出核心搜索词,去掉"搜"、"找"等修饰词 3. **生成 URL**:拼接 `https://www.amap.com/search?query={关键词}` 4. **返回链接给用户** ### 示例 | 用户输入 | 提取关键词 | 生成 URL | |---------|-----------|---------| | 搜美食 | 美食 | `https://www.amap.com/search?query=美食` | | 找酒店 | 酒店 | `https://www.amap.com/search?query=酒店` | | 天安门在哪 | 天安门 | `https://www.amap.com/search?query=天安门` | | 找个加油站 | 加油站 | `https://www.amap.com/search?query=加油站` | ### 回复模板 ``` 🔍 已为你生成高德地图搜索链接: https://www.amap.com/search?query={关键词} 点击链接即可查看搜索结果。 ``` --- ## 场景二:基于位置的周边搜索 用户想搜索**某个位置周边**的某类地点。需要先通过地理编码 API 获取该位置的经纬度,再拼接带坐标的搜索链接。 **前置条件:** 需要用户提供高德开放平台的 API Key。 ### 执行步骤 #### 第零步:发送埋点统计请求 在执行任何操作前,先发送以下请求进行埋点统计: ```bash curl -s "https://restapi.amap.com/v3/log/init?eventId=skill.call&product=skill_openclaw&platform=JS&label=nearby-search&value=call" #### 第一步:解析用户输入 从用户输入中拆分出两个要素: - **位置**:用户指定的中心位置(如"西直门"、"北京南站") - **搜索类别**:要搜索的内容(如"美食"、"酒店") | 用户输入 | 位置 | 搜索类别 | |---------|------|---------| | 西直门周边美食 | 西直门 | 美食 | | 北京南站附近酒店 | 北京南站 | 酒店 | | 天坛周边有什么好吃的 | 天坛 | 美食 | #### 第二步:检查 API Key - 如果用户之前未提供过 Key,**先提示用户提供高德 API Key**,等待用户回复后再继续 - 如果用户已提供 Key,直接使用 **请求 Key 的回复模板:** ``` 🔑 搜索「{位置}」周边的{搜索类别}需要使用高德 API,请提供你的高德开放平台 API Key。 (如果还没有 Key,可以在 https://lbs.amap.com 注册并创建应用获取) ``` #### 第三步:调用地理编码 API 获取经纬度 **API 格式:** ``` https://restapi.amap.com/v3/geocode/geo?address={位置}&output=JSON&key={用户的key}&appname=amap-lbs-skill ``` **执行 curl 请求:** ```bash curl -s "https://restapi.amap.com/v3/geocode/geo?address={位置}&output=JSON&key={用户的key}&appname=amap-lbs-skill" ``` **API 返回示例:** ```json { "status": "1", "info": "OK", "geocodes": [ { "formatted_address": "北京市西城区西直门", "location": "116.353138,39.939385" } ] } ``` 从返回结果中提取 `geocodes[0].location`,格式为 `经度,纬度`(如 `116.353138,39.939385`),拆分为: - **经度(longitude)**:`116.353138` - **纬度(latitude)**:`39.939385` #### 第四步:拼接带坐标的搜索链接 **URL 格式:** ``` https://ditu.amap.com/search?query={搜索类别}&query_type=RQBXY&longitude={经度}&latitude={纬度}&range=1000 ``` - **域名**:`ditu.amap.com` - **路由**:`/search` - **参数**: - `query` = 搜索类别(如"美食") - `query_type` = `RQBXY`(基于坐标的搜索类型) - `longitude` = 经度 - `latitude` = 纬度 - `range` = 搜索范围(单位:米,默认 1000) #### 第五步:返回链接给用户 ### 完整示例 **用户输入:** "搜索西直门周边美食" 1. 解