I grabbed Nabeel files for moving to leaflet and all is well except 1 thing–whenever you click on an aircraft that’s on live map you get the bubble popup that shows flight info, nav markers for route, etc. However, when you click X the only thing that disappears is navbubble. How do you get all the markers clear?
— SOLUTION —
If you want the points to disappear when clicking “X” in the pop up find the following in acarsmap.js
.bindPopup(tmpl("navpoint\_bubble", { nav: nav })) .bindPopup(detailed\_bubble)
and replace with
.bindPopup(tmpl("navpoint\_bubble", { nav: nav })).on("popupopen", () =\> { $(".leaflet-popup-close-button").on("click", e =\> { clearSelMarkers(); }) }) .bindPopup(detailed\_bubble).on("popupopen", () =\> { $(".leaflet-popup-close-button").on("click", e =\> { clearSelMarkers(); }) })
The markers on the map for VOR, fix, etc, - those along the planned route line, should disappear in 10-30 seconds without any input from the user. I believe the default is 10,000 ms (10 seconds).
The markers on the map for VOR, fix, etc, - those along the planned route line, should disappear in 10-30 seconds without any input from the user. I believe the default is 10,000 ms (10 seconds).
I thought that 10,000 was refresh rate of the map. Is that the only way to clear markers?
Update it doesn’t clear markers for me. I click on airplane; I get the markers for dep/arr/nav fixes and bubble over aircraft showing details. In 10 seconds the bubble disappears but the markers stay and I’m stuck zoomed in on that flight. I want the opposite to happen; I want all markers to go away at most. So that when I zoom out I have clean map of just airplane icons until I click another flight. I’ve seen other maps do it with Google where you click X on navbubble and it clears everything. I’m not real good with leaflet so I haven’t found magic button that does it. I see where markers get pushed tho.