mirror of
https://github.com/pe1hvh/meshcore-gui.git
synced 2026-07-06 09:52:09 +02:00
fix: route back-button and map popup flicker (#1.13.5)
- Replace two fixed-destination back-buttons on the route page with a single arrow_back button using window.history.back(), so navigation always returns to the calling screen (Messages or Archive). - Guard setIcon() and setPopupContent() in applyDevice/applyContacts behind isPopupOpen() to prevent popup flickering on the 500 ms update tick. - Set fadeAnimation: false and markerZoomAnimation: false on both Leaflet map instances (main map and route map) to eliminate popup flash on first click, particularly noticeable on Raspberry Pi.
This commit is contained in:
@@ -81,6 +81,8 @@
|
||||
maxZoom: 19,
|
||||
zoomControl: true,
|
||||
preferCanvas: true,
|
||||
fadeAnimation: false,
|
||||
markerZoomAnimation: false,
|
||||
});
|
||||
|
||||
const state = {
|
||||
@@ -289,8 +291,11 @@
|
||||
}
|
||||
|
||||
state.deviceMarker.setLatLng(latLng);
|
||||
state.deviceMarker.setIcon(icon);
|
||||
state.deviceMarker.setPopupContent(popupHtml);
|
||||
const devicePopupOpen = state.deviceMarker.isPopupOpen();
|
||||
if (!devicePopupOpen) {
|
||||
state.deviceMarker.setIcon(icon);
|
||||
state.deviceMarker.setPopupContent(popupHtml);
|
||||
}
|
||||
state.deviceMarker.options.title = '📡 ' + device.name;
|
||||
}
|
||||
|
||||
@@ -318,8 +323,11 @@
|
||||
}
|
||||
|
||||
existing.setLatLng(latLng);
|
||||
existing.setIcon(markerIcon);
|
||||
existing.setPopupContent(popupHtml);
|
||||
const contactPopupOpen = existing.isPopupOpen();
|
||||
if (!contactPopupOpen) {
|
||||
existing.setIcon(markerIcon);
|
||||
existing.setPopupContent(popupHtml);
|
||||
}
|
||||
existing.options.title = markerTitle;
|
||||
if (!state.layers.contacts.hasLayer(existing)) {
|
||||
state.layers.contacts.addLayer(existing);
|
||||
@@ -577,6 +585,8 @@
|
||||
maxZoom: 19,
|
||||
zoomControl: true,
|
||||
preferCanvas: true,
|
||||
fadeAnimation: false,
|
||||
markerZoomAnimation: false,
|
||||
});
|
||||
host.__meshcoreRouteMap = map;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user