Implement real-time session location map with zoom functionality

- Added a new RealtimePage component to display live session locations on a map.
- Integrated zoom handling to adjust circle sizes based on session counts.
- Utilized GeoJSON for rendering country boundaries and added tooltips for session count visibility.
- Updated server routes to fetch live session locations data.
This commit is contained in:
Bill Yang 2025-03-30 22:49:03 -07:00
parent 67af002ec7
commit cf62c8ccc8
6 changed files with 246 additions and 5 deletions

View file

@ -64,6 +64,7 @@ class PageviewQueue {
const regionCode = dataForIp?.data?.subdivisions?.[0]?.isoCode || "";
const latitude = dataForIp?.data?.latitude || 0;
const longitude = dataForIp?.data?.longitude || 0;
const city = dataForIp?.data?.city || "";
return {
site_id: pv.site_id,
@ -88,6 +89,7 @@ class PageviewQueue {
country: countryCode,
iso_3166_2:
countryCode && regionCode ? countryCode + "-" + regionCode : "",
city: city || "",
lat: latitude || 0,
lon: longitude || 0,
type: pv.type || "pageview",