mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 04:17:43 +00:00
Fix ADS-B not updating Altitude in Map #473
This commit will fix altitude not automatically updating when in Map mode. Also set default altitude for AIS to 0.
This commit is contained in:
@@ -253,14 +253,16 @@ void GeoMapView::focus() {
|
||||
nav_.display_modal("No map", "No world_map.bin file in\n/ADSB/ directory", ABORT, nullptr);
|
||||
}
|
||||
|
||||
void GeoMapView::update_position(float lat, float lon, uint16_t angle) {
|
||||
void GeoMapView::update_position(float lat, float lon, uint16_t angle, int32_t altitude) {
|
||||
lat_ = lat;
|
||||
lon_ = lon;
|
||||
altitude_ = altitude;
|
||||
|
||||
// Stupid hack to avoid an event loop
|
||||
geopos.set_report_change(false);
|
||||
geopos.set_lat(lat_);
|
||||
geopos.set_lon(lon_);
|
||||
geopos.set_altitude(altitude_);
|
||||
geopos.set_report_change(true);
|
||||
|
||||
geomap.set_angle(angle);
|
||||
|
@@ -177,7 +177,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
void update_position(float lat, float lon, uint16_t angle);
|
||||
void update_position(float lat, float lon, uint16_t angle, int32_t altitude);
|
||||
|
||||
std::string title() const override { return "Map view"; };
|
||||
|
||||
|
Reference in New Issue
Block a user