目录

OpenStreetMap Service

Web service for displaying markers, circles, and alerts on OpenStreetMap.

Quick Start

npm install
npm start

Visit http://localhost:3000

API Documentation

Swagger UI documentation is available at: http://localhost:3000/api-docs

JSON schema available at: http://localhost:3000/api-docs.json

API Endpoints

Add Marker

GET /api/marker?lat=<lat>&lng=<lng>&icon=<icon>&title=<title>

Add Circle

GET /api/circle?lat=<lat>&lng=<lng>&radius=<radius>&icon=<icon>&title=<title>

Create Alert

POST /api/alert?message=<message>&type=<type>

Parameters:

  • message (required) - Alert text content
  • type (optional) - Alert style: danger (red), warning (orange), info (blue), success (green). Default: danger

Example:

curl -X POST "http://localhost:3000/api/alert?message=Server%20Error&type=danger"

Get Alerts

GET /api/alerts

Clear All Alerts

POST /api/alerts/clear

How Alerts Work

  1. The map page at http://localhost:3000 polls for new alerts every 3 seconds
  2. When you call POST /api/alert, the alert is stored on the server
  3. Any open map page will automatically display the new alert prominently
  4. Alerts appear in the top-right corner of the map with animation
  5. Each alert can be dismissed individually or cleared all at once
关于
4.8 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号