adsb.exposed icon indicating copy to clipboard operation
adsb.exposed copied to clipboard

Capture map visibility (opacity - eye button) state in url for link sharing

Open mhansen opened this issue 3 months ago • 1 comments

I would like to link someone to see a map with the base map shown (eg after clicking the eye button at bottom left)

I copy this link

https://adsb.exposed/?dataset=Planes&zoom=18&lat=-33.9021&lng=151.1767&query=f3fa6f78cbef2ffb60baafae766e333a

But they open it and it shows a dark background map, like the eye button hasn’t been pressed

Feature request: capture eye button state in URL for link sharing

Thank you

mhansen avatar Oct 08 '25 01:10 mhansen

Here's the click handler on the eye button: https://github.com/ClickHouse/adsb.exposed/blob/3d7696058c2e9c5d27c70e131fa4ae151709a07a/index.html#L1246

Here's the code that restores from URL params on load: https://github.com/ClickHouse/adsb.exposed/blob/3d7696058c2e9c5d27c70e131fa4ae151709a07a/index.html#L765-L794

upateHistory sets the URL state: https://github.com/ClickHouse/adsb.exposed/blob/3d7696058c2e9c5d27c70e131fa4ae151709a07a/index.html#L1260-L1278

mhansen avatar Oct 08 '25 03:10 mhansen