fix ttn location parse
This commit is contained in:
parent
64b77c33b5
commit
7e42d3b8c9
@ -33,11 +33,8 @@ const CalculateTtnGatewayLocation = (event: TtnMessageReceivedEvent) => {
|
||||
});
|
||||
|
||||
// Calculate the weighted average to get the virtual location
|
||||
const virtualLocation = {
|
||||
latitude: weightedLatitude / totalWeight,
|
||||
longitude: weightedLongitude / totalWeight
|
||||
};
|
||||
|
||||
virtualLocation.latitude = weightedLatitude / totalWeight;
|
||||
virtualLocation.longitude = weightedLongitude / totalWeight;
|
||||
console.log("Tracker location based on TTN Gateway location:", virtualLocation);
|
||||
}
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user