mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-30 02:52:04 +08:00
ui/map: keep the car icon aligned to its bearing (#29482)
* rotate icon with current bearing When user is rotating the map, the car icon should stay fixed on the cars bearing, not the map. * spacing * comment --------- Co-authored-by: Shane Smiskol <shane@smiskol.com> old-commit-hash: 472151b6a004d387532415039196c2165f7d32df
This commit is contained in:
@@ -191,6 +191,11 @@ void MapWindow::updateState(const UIState &s) {
|
||||
carPosSource["type"] = "geojson";
|
||||
carPosSource["data"] = QVariant::fromValue<QMapbox::Feature>(feature1);
|
||||
m_map->updateSource("carPosSource", carPosSource);
|
||||
|
||||
// Map bearing isn't updated when interacting, keep location marker up to date
|
||||
if (last_bearing) {
|
||||
m_map->setLayoutProperty("carPosLayer", "icon-rotate", *last_bearing - m_map->bearing());
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction_counter == 0) {
|
||||
|
||||
Reference in New Issue
Block a user