Go to file
zhangxunhui cada718638 update 2026-03-29 00:23:50 +08:00
node_modules update 2026-03-29 00:23:50 +08:00
public update 2026-03-29 00:23:50 +08:00
README.md update js 2026-03-26 23:38:21 +08:00
openapi.json update 2026-03-29 00:23:50 +08:00
package-lock.json update 2026-03-29 00:23:50 +08:00
package.json update 2026-03-29 00:23:50 +08:00
server.js update 2026-03-29 00:23:50 +08:00

README.md

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