Add FOV cone visualization to map screens; refactor geoMath utility for heading and cone calculations

Have FOV config as it's own thing so it's easier to change the size of the FOV triangle without having to change multiple parts of the maths for it.

Fov triangle needed because for some reason maps doesn't let us have our own fov ??
This commit is contained in:
bobbert committed 2026-04-07 17:19:25 +01:00
1 parent c4c8fcf91d
commit 1e405bb87f
5 files changed
+64 -84

No files matched your search

+1 -3
View File
@@ -4,7 +4,7 @@ const path = require('path');
// --- Configuration ---
const PORT = process.env.PORT || 80;
const PORT = process.env.PORT || 3000;
const DATA_DIR = path.join(__dirname, 'data');
// --- Data Helpers ---
@@ -560,7 +560,6 @@ addRoute('GET', '/game-data/:gid', (req, res, params) => {
// Helper: convert storage cache to API response format
const toCacheApi = (cache, gid) => ({
id: cache.CacheId,
name: cache.Name || '',
coordinates: { latitude: cache.Latitude, longitude: cache.Longitude },
radius: cache.TriggerMeters,
clue: cache.Title,
@@ -573,7 +572,6 @@ const toCacheApi = (cache, gid) => ({
// Helper: convert API payload to storage cache format
const toCacheStorage = (data, cacheId) => ({
CacheId: cacheId,
Name: data.name || data.Name || '',
Title: data.clue || data.Title || '',
Latitude: data.latitude != null ? data.latitude : (data.Latitude || 0),
Longitude: data.longitude != null ? data.longitude : (data.Longitude || 0),