Add geographic coordinates to IP data and enhance map visualization
- Introduced latitude and longitude fields in the IP data structure to support geographic information. - Updated the API documentation to reflect the inclusion of geographic coordinates in the unique IPs endpoint. - Enhanced the UI to display a map of connections using Leaflet, providing a visual representation of IP locations based on the new geographic data. - Improved the handling of GeoIP data to ensure accurate mapping and user experience when GeoIP is enabled.
This commit is contained in:
@@ -28,6 +28,12 @@ func EnrichUniqueIPsGeo(rows []UniqueIPsRow, g *geoip.Service) {
|
||||
s := res.CityName
|
||||
rows[i].IPs[j].CityName = &s
|
||||
}
|
||||
if res.Latitude != 0 || res.Longitude != 0 {
|
||||
lat := res.Latitude
|
||||
lon := res.Longitude
|
||||
rows[i].IPs[j].Latitude = &lat
|
||||
rows[i].IPs[j].Longitude = &lon
|
||||
}
|
||||
if res.ASN != 0 {
|
||||
a := res.ASN
|
||||
rows[i].IPs[j].ASN = &a
|
||||
|
||||
Reference in New Issue
Block a user