Files
test-map-distance/public/docs-web.md
2026-01-09 23:14:45 +08:00

49 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 网页版地图距离计算器
在线使用:[https://kevisual.xiongxiao.me/root/test-map-distance/web.html](https://kevisual.xiongxiao.me/root/test-map-distance/web.html)
## 功能特性
- AMAP_KEY 保存到浏览器localStorage无需重复输入
- 上传 JSON 文件批量计算距离
- 使用 Haversine 公式计算两点间直线距离
- 结果表格展示
- 导出 CSV 文件
## 使用方法
### 1. 配置高德地图 Key
1. 访问 [高德开放平台](https://console.amap.com/dev/key/app) 注册/登录账号
2. 创建 Web 应用,获取 API Key
3. 在网页中输入 Key点击「保存 Key」
### 2. 准备 JSON 数据
创建 JSON 文件,格式如下:
```json
[
{"from": "北京市", "to": "上海市"},
{"from": "广州市", "to": "深圳市"},
{"from": "杭州市", "to": "南京市"}
]
```
### 3. 上传并计算
1. 点击「选择文件」,上传准备好的 JSON 文件
2. 点击「开始计算」
3. 等待计算完成,查看结果表格
### 4. 导出结果
计算完成后,点击「导出 CSV」下载结果文件。
## 注意事项
- 需要有效的 AMAP_KEY 才能正常使用
- 地理编码服务有每日调用限制
- 地址越精确,计算结果越准确
- 直线距离与实际行驶距离可能存在差异