Live Map
Real-time player position visualization using Leaflet and Prometheus metrics.
Overviewβ
The live map provides:
- πΊοΈ Interactive GTA5 map with pan & zoom
- π Real-time player markers with directional heading
- π₯ Player list sidebar
- π¨ Multiple map styles (Satellite, Atlas, Grid)
- π Auto-updates every 5 seconds
Architectureβ
Setupβ
1. Start Servicesβ
docker compose up -d prometheus livemap
2. Accessβ
- Live Map: http://localhost:3002
- Prometheus: http://localhost:9090
Adding Map Tiles (Optional)β
The map works with a grid background by default. For actual GTA5 imagery:
-
Download tiles from gta-v-map-leaflet
-
Extract to
infra/livemap/tiles/:tiles/
βββ satellite/{z}/{x}/{y}.png
βββ atlas/{z}/{x}/{y}.png
βββ grid/{z}/{x}/{y}.png -
Update
infra/livemap/index.html:const CONFIG = {
useFallback: false, // Enable real tiles
}; -
Restart:
docker compose restart livemap
Configurationβ
Edit CONFIG in infra/livemap/index.html:
const CONFIG = {
prometheusUrl: "http://localhost:9090",
updateInterval: 5000, // milliseconds
useFallback: true, // Use grid background
};
Grafana Integrationβ
Embed in Grafana using a Text panel (HTML mode):
<iframe src="http://localhost:3002" width="100%" height="600" frameborder="0"></iframe>
Troubleshootingβ
"Connection error" in statusβ
- Check Prometheus is running:
docker compose ps prometheus - Verify CORS is enabled in compose config
- Confirm FiveM server exports metrics on port 9100
No players showingβ
- Ensure FiveM server is running
- Test metrics:
curl http://localhost:9090/api/v1/query?query=fivem_player_position_x
Map tiles not loadingβ
- Verify tiles are extracted to correct folder
- Set
useFallback: falsein config - Check browser console for 404 errors