There was an error while loading. Please reload this page.
1 parent fa60eaf commit 90e4f16Copy full SHA for 90e4f16
1 file changed
app/javascript/maplibre/feature/elevation.js
@@ -198,6 +198,7 @@ export async function showElevationChart (feature) {
198
199
// Update GPS position indicator on the chart
200
window.addEventListener('gps-position', (event) => {
201
+ if (elevationContainer.offsetParent === null) return
202
if (!event.detail) {
203
lastGpsPosition = null
204
chart._gpsChartIndex = null
@@ -217,6 +218,7 @@ export async function showElevationChart (feature) {
217
218
219
// Sync chart with map viewport — show only the track section currently visible
220
syncChartToViewport = () => {
221
222
if (!chart.canvas || !chart.canvas.isConnected) {
223
map.off('moveend', syncChartToViewport)
224
syncChartToViewport = null
0 commit comments