返回顶部
g

google-maps谷歌地图

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 3.2.0
安全检测
已通过
4,029
下载量
免费
免费
8
收藏
概述
安装方式
版本历史

google-maps

Google Maps 🗺️

基于 Routes API 的 Google Maps 集成。

要求

  • - GOOGLEAPIKEY 环境变量
  • 在 Google Cloud Console 中启用:Routes API、Places API、Geocoding API
  • Python 包:requests(pip install requests)

配置

环境变量默认值描述
GOOGLEAPIKEY-必填。您的 Google Maps API 密钥
GOOGLEMAPSAPIKEY
- | GOOGLEAPI_KEY 的替代方案(备用) | | GOOGLEMAPSLANG | en | 响应语言(en、he、ja 等) |

在 OpenClaw 配置中设置:
json
{
env: {
GOOGLEAPIKEY: AIza...,
GOOGLEMAPSLANG: en
}
}

脚本位置

bash
python3 skills/google-maps/lib/map_helper.py [options]



操作

distance - 计算行程时间

bash
python3 skills/google-maps/lib/map_helper.py distance 起点 终点 [options]

选项:

选项描述
--modedriving、walking、bicycling、transit出行方式(默认:driving)
--depart
now、+30m、+1h、14:00、2026-02-07 08:00 | 出发时间 |
| --arrive | 14:00 | 到达时间(仅限 transit) |
| --traffic | best_guess、pessimistic、optimistic | 交通模型 |
| --avoid | tolls、highways、ferries | 逗号分隔 |

示例:
bash
python3 skills/google-maps/lib/map_helper.py distance 纽约 波士顿
python3 skills/google-maps/lib/map_helper.py distance 洛杉矶 旧金山 --depart=+1h
python3 skills/google-maps/lib/map_helper.py distance 芝加哥 底特律 --depart=08:00 --traffic=pessimistic
python3 skills/google-maps/lib/map_helper.py distance 伦敦 曼彻斯特 --mode=transit --arrive=09:00
python3 skills/google-maps/lib/map_helper.py distance 巴黎 里昂 --avoid=tolls,highways

响应:
json
{
distance: 215.2 mi,
distance_meters: 346300,
duration: 3 hrs 45 mins,
duration_seconds: 13500,
static_duration: 3 hrs 30 mins,
durationintraffic: 3 hrs 45 mins
}



directions - 逐向导航路线

bash
python3 skills/google-maps/lib/map_helper.py directions 起点 终点 [options]

附加选项(除 distance 外):

选项描述
--alternatives返回多条路线
--waypoints
中途停靠点(竖线分隔) |
| --optimize | 优化途经点顺序(TSP) |

示例:
bash
python3 skills/google-maps/lib/map_helper.py directions 纽约 华盛顿特区
python3 skills/google-maps/lib/map_helper.py directions 旧金山 洛杉矶 --alternatives
python3 skills/google-maps/lib/map_helper.py directions 迈阿密 奥兰多 --waypoints=劳德代尔堡|西棕榈滩 --optimize

响应包含: 摘要、标签、时长、静态时长、警告、步骤[]、优化后的途经点顺序



matrix - 距离矩阵

计算多个起点和终点之间的距离:

bash
python3 skills/google-maps/lib/map_helper.py matrix 起点1|起点2 终点1|终点2

示例:
bash
python3 skills/google-maps/lib/map_helper.py matrix 纽约|波士顿 费城|华盛顿特区

响应:
json
{
origins: [纽约, 波士顿],
destinations: [费城, 华盛顿特区],
results: [
{originindex: 0, destinationindex: 0, distance: 97 mi, duration: 1 hr 45 mins},
{originindex: 0, destinationindex: 1, distance: 225 mi, duration: 4 hrs 10 mins}
]
}



geocode - 地址转坐标

bash
python3 skills/google-maps/lib/map_helper.py geocode 1600 Amphitheatre Parkway, Mountain View, CA
python3 skills/google-maps/lib/map_helper.py geocode 唐宁街10号,伦敦

reverse - 坐标转地址

bash
python3 skills/google-maps/lib/map_helper.py reverse 40.7128 -74.0060 # 纽约市
python3 skills/google-maps/lib/map_helper.py reverse 51.5074 -0.1278 # 伦敦



search - 查找地点

bash
python3 skills/google-maps/lib/map_helper.py search 时代广场附近的咖啡
python3 skills/google-maps/lib/map_helper.py search 旧金山的药店 --open

details - 地点信息

bash
python3 skills/google-maps/lib/maphelper.py details id>



交通模型


模型使用场景
best_guess默认平衡估算
pessimistic
重要会议(最坏情况) |
| optimistic | 最佳情况 |


区域说明

某些功能可能并非在所有国家/地区可用:

功能可用性
--fuel-efficient美国、欧盟、特定国家
--shorter
有限可用性 |
| --mode=two_wheeler | 亚洲、特定国家 |

详情请查看 Google Maps 覆盖范围



多语言支持

支持任何语言的地址:

bash

希伯来语


python3 skills/google-maps/lib/map_helper.py distance תל אביב ירושלים
python3 skills/google-maps/lib/map_helper.py geocode דיזנגוף 50, תל אביב

日语

python3 skills/google-maps/lib/map_helper.py distance 東京 大阪

阿拉伯语

python3 skills/google-maps/lib/map_helper.py distance دبي أبو ظبي

语言配置:

  1. 1. 通过环境变量设置默认值:GOOGLEMAPSLANG=he(持久化)
  2. 每次请求覆盖:--lang=ja

bash

在 OpenClaw 配置中将希伯来语设为默认值


GOOGLEMAPSLANG=he

覆盖特定请求

python3 skills/google-maps/lib/map_helper.py distance 东京 大阪 --lang=ja

帮助

bash
python3 skills/google-maps/lib/map_helper.py help

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-maps-1776366960 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-maps-1776366960 技能

通过命令行安装

skillhub install google-maps-1776366960

下载

⬇ 下载 google-maps v3.2.0(免费)

文件大小: 10.71 KB | 发布时间: 2026-4-17 14:52

v3.2.0 最新 2026-4-17 14:52
- Updated version to 3.2.0
- Added explicit requirement for the Python requests package in the metadata section and documentation
- Improved requirements section to mention pip install requests
- Clarified and listed optional environment variables and added more detailed metadata notes
- Updated all usage examples to use the fully qualified script path (skills/google-maps/lib/map_helper.py)

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部