Added google maps heatmap

This commit is contained in:
2020-11-11 16:55:50 +01:00
parent 4281c2d524
commit a52f6acd71
26 changed files with 1011 additions and 1217 deletions

View File

@ -28,7 +28,7 @@ namespace Birdmap.API.Services.Hubs
return base.OnDisconnectedAsync(exception);
}
public Task UserJoinedAsync(Guid deviceId, DateTime date, double probability)
public Task SendNotification(Guid deviceId, DateTime date, double probability)
{
return Clients.All.NotifyDeviceAsync(deviceId, date, probability);
}

View File

@ -57,10 +57,17 @@ namespace Birdmap.API.Services.Mqtt
_logger.LogInformation($"Recieved [{eventArgs.ClientId}] " +
$"Topic: {eventArgs.ApplicationMessage.Topic} | Payload: {message} | QoS: {eventArgs.ApplicationMessage.QualityOfServiceLevel} | Retain: {eventArgs.ApplicationMessage.Retain}");
var payload = JsonConvert.DeserializeObject<Payload>(message);
var inputResponse = await _inputService.GetInputAsync(payload.TagID);
try
{
var payload = JsonConvert.DeserializeObject<Payload>(message);
var inputResponse = await _inputService.GetInputAsync(payload.TagID);
await _hubContext.Clients.All.NotifyDeviceAsync(inputResponse.Message.Device_id, inputResponse.Message.Date.UtcDateTime, payload.Probability);
await _hubContext.Clients.All.NotifyDeviceAsync(inputResponse.Message.Device_id, inputResponse.Message.Date.UtcDateTime, payload.Probability);
}
catch (Exception ex)
{
_logger.LogError(ex, $"Could not handle application message.");
}
}
public async Task HandleConnectedAsync(MqttClientConnectedEventArgs eventArgs)