Go to file
2026-01-12 12:37:51 +08:00
static Refine floating result button and sidebar styles: adjust positioning, enhance button appearance with animations and gradients, and update JavaScript to hide the button when results are displayed. Update versioning in HTML for CSS and JS files. 2026-01-12 12:37:51 +08:00
templates Refine floating result button and sidebar styles: adjust positioning, enhance button appearance with animations and gradients, and update JavaScript to hide the button when results are displayed. Update versioning in HTML for CSS and JS files. 2026-01-12 12:37:51 +08:00
.gitignore Enhance main.go by embedding static files and templates, improve logging during service startup, and update README with detailed API Key instructions and deployment steps. 2026-01-09 19:05:06 +08:00
build-linux.bat Refactor main.go to embed static files and templates, update logging for service start, and enhance README with API Key instructions and deployment steps. 2026-01-09 18:59:41 +08:00
build.bat Refactor main.go to embed static files and templates, update logging for service start, and enhance README with API Key instructions and deployment steps. 2026-01-09 18:59:41 +08:00
config.example.json first 2026-01-09 18:52:32 +08:00
config.json first 2026-01-09 18:52:32 +08:00
go.mod first 2026-01-09 18:52:32 +08:00
go.sum first 2026-01-09 18:52:32 +08:00
main.go Implement mobile UI enhancements including a sidebar, mobile search functionality, and a floating results button. Add port checking and killing logic in main.go. Update HTML and CSS for mobile responsiveness and new UI elements. 2026-01-12 12:13:58 +08:00
meeting-point-linux-amd64 Update binary files for meeting-point application on Linux and Windows platforms. 2026-01-12 12:20:05 +08:00
meeting-point.exe Update binary files for meeting-point application on Linux and Windows platforms. 2026-01-12 12:20:05 +08:00
README.md Enhance location features in the map application: update README for automatic location detection, adjust CSS for mobile geolocation controls, and improve JavaScript for IP and precise geolocation handling. 2026-01-12 12:29:57 +08:00

会面点 Meeting Point

一个帮助多人寻找最佳聚会地点的地图应用。输入多个参与者的位置自动计算几何中心并在中心点附近搜索咖啡馆、餐厅、KTV 等聚会场所。

功能特点

  • 📍 多点位置设置

    • 通过地址搜索添加位置(支持输入提示和自动补全)
    • 直接在地图上点击添加位置(无需确认,即点即加)
    • 支持删除和管理已添加的位置
    • 启动时自动定位(先 IP 定位快速显示,再精确定位)
    • 右下角定位按钮可随时重新定位
  • 🎯 智能中心计算

    • 使用球面几何算法计算多点中心
    • 准确计算地球曲面上的几何中心
  • 🔍 周边搜索

    • 支持自定义搜索关键词
    • 可调节搜索半径500米-10公里默认1公里
    • 预设常用场所类型咖啡馆、餐厅、网咖、棋牌室、KTV、电影院、健身房、书店
    • 搜索结果支持名称/地址筛选
    • 未设置搜索类型时自动弹出设置面板
  • 🗺️ 地图可视化

    • 深色主题地图
    • 清晰的标记和信息展示
    • 搜索范围可视化(橙色圆圈)
    • 半透明信息窗口
  • 📱 移动端适配

    • 完整的响应式设计
    • 底部弹出式设置面板
    • 底部快捷操作栏
    • 触摸优化的交互体验
  • 🧭 导航功能

    • 点击搜索结果可查看详情
    • 一键跳转高德地图导航
  • 🔧 智能端口管理

    • 启动时自动检测端口占用
    • 自动释放被占用的端口

🚀 快速开始

方式一:下载可执行文件(推荐)

  1. 从 Releases 下载对应系统的可执行文件
  2. 创建 config.json 配置文件
  3. 运行程序

方式二:从源码构建

前置要求

  • Go 1.21+
  • 高德地图开发者账号

获取高德地图 API Key

  1. 访问 高德开放平台
  2. 注册/登录开发者账号
  3. 进入「控制台」→「应用管理」→「创建新应用」
  4. 添加两个 Key
    • Web服务 类型 - 用于后端 API 调用
    • Web端(JS API) 类型 - 用于前端地图展示
  5. JS API Key 需要配置安全密钥

安装步骤

# 克隆项目
git clone https://github.com/yourusername/meeting-point.git
cd meeting-point

# 安装依赖
go mod download

# 复制配置文件
cp config.example.json config.json

# 编辑 config.json填入 API Key

# 启动服务
go run main.go

构建可执行文件

# Windows
go build -ldflags="-s -w" -o meeting-point.exe .

# Linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o meeting-point-linux-amd64 .

# macOS
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o meeting-point-darwin-amd64 .

⚙️ 配置说明

config.json

{
    "amap_key": "你的Web服务API_Key",
    "amap_js_key": "你的JS_API_Key",
    "amap_js_secret": "你的JS_API安全密钥",
    "port": "9876"
}
字段 必填 说明
amap_key 高德 Web 服务 API Key用于后端地理编码和 POI 搜索
amap_js_key 高德 JS API Key用于前端地图展示。不填则使用 amap_key
amap_js_secret 高德 JS API 安全密钥JS API 2.0 必需
port 服务端口,默认 8080

环境变量

环境变量优先级高于配置文件:

  • AMAP_KEY - 高德 Web 服务 API Key
  • PORT - 服务端口

📖 使用说明

添加位置

有两种方式添加参与者位置:

  1. 搜索添加:在搜索框中输入地址或地点名称,从下拉列表中选择
  2. 点击添加:直接在地图上点击想要添加的位置(即点即加)

搜索聚会地点

  1. 添加至少 2 个位置点
  2. 在「搜索类型」中输入或选择想要查找的场所类型
  3. 调整搜索半径默认1公里
  4. 点击「搜索最佳会面点」按钮

查看结果

  • 地图上会显示计算出的中心点(金色星星标记)
  • 搜索到的场所会以绿色标记显示
  • 浮动面板显示搜索结果列表PC端右侧移动端底部弹出
  • 支持按名称/地址筛选结果
  • 点击结果项可在地图上定位并显示详情
  • 点击「导航前往」可跳转高德地图导航

🏗️ 技术架构

后端

  • Go - 高性能后端语言
  • Gin - Web 框架
  • embed - 静态资源嵌入(单文件部署)
  • 高德地图 Web API - 地理编码、POI 搜索

前端

  • 原生 JavaScript - 无框架依赖
  • 高德地图 JS API 2.0 - 地图展示和交互
  • CSS3 - 现代化深色主题 UI完整响应式设计

API 端点

方法 路径 说明
GET / 主页面
GET /api/config 获取配置
POST /api/geocode 地址转坐标
POST /api/center 计算中心点
POST /api/search 搜索周边 POI
GET /api/tips 输入提示

📁 项目结构

meeting-point/
├── main.go              # 后端主程序(包含嵌入的静态资源)
├── go.mod               # Go 模块文件
├── go.sum               # 依赖锁定文件
├── config.json          # 配置文件(需创建)
├── config.example.json  # 配置文件模板
├── build.bat            # Windows 构建脚本
├── build-linux.bat      # Linux 构建脚本
├── README.md            # 项目说明
├── templates/
│   └── index.html       # 前端页面模板
└── static/
    ├── css/
    │   └── style.css    # 样式文件
    └── js/
        └── app.js       # 前端逻辑

🐧 Linux 部署

# 上传可执行文件和配置文件到服务器

# 设置执行权限
chmod +x meeting-point-linux-amd64

# 创建配置文件
cat > config.json << 'EOF'
{
    "amap_key": "你的Web服务API_Key",
    "amap_js_key": "你的JS_API_Key",
    "amap_js_secret": "你的JS_API安全密钥",
    "port": "9876"
}
EOF

# 前台运行
./meeting-point-linux-amd64

# 后台运行
nohup ./meeting-point-linux-amd64 > meeting-point.log 2>&1 &

# 使用 systemd 管理(推荐)
# 创建 /etc/systemd/system/meeting-point.service

Systemd 服务配置

[Unit]
Description=Meeting Point Service
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/meeting-point
ExecStart=/opt/meeting-point/meeting-point-linux-amd64
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

📝 更新日志

v1.1.0

  • 完整的移动端适配
  • 点击地图直接添加位置(无需确认)
  • 启动时自动 IP 定位
  • 智能端口占用检测和释放
  • 未设置搜索类型时自动弹出设置面板
  • 搜索半径默认改为1公里
  • 优化浮动按钮样式

v1.0.0

  • 🎉 首次发布
  • 多点位置设置
  • 智能中心计算
  • 周边 POI 搜索
  • 高德地图导航

📄 许可证

MIT License

🤝 贡献

欢迎提交 Issue 和 Pull Request