Skip to content

Commit

Permalink
minor extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
lolochristen committed Jan 10, 2024
1 parent 6cbc9ca commit 56e7819
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
var c2 = new Coordinate(_map.VisibleExtent.X2, _map.VisibleExtent.Y2);
var visibleDistance = c1.DistanceTo(c2);
var nmVisibleRadius = visibleDistance / 2 * 0.5399568; // to nm
var response = await _httpClient.GetAsync($"https://api.adsb.lol/v2/point/{center.Y}/{center.X}/{(int)nmVisibleRadius}");
_flightData = await response.Content.ReadFromJsonAsync<AdsbResponse>();

Expand All @@ -96,6 +96,8 @@
{
_logger.LogError(exp, "Error reading flight tracking data");
}

StateHasChanged();
}

public class AdsbResponse
Expand Down
11 changes: 7 additions & 4 deletions src/OpenLayers.Blazor.Demo/staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"globalHeaders": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, OPTIONS"
}
"navigationFallback": {
"rewrite": "/index.html"
},
"globalHeaders": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, OPTIONS"
}
}

0 comments on commit 56e7819

Please sign in to comment.