fratsloos / fr24_card

Lovelace card for showing Dump1090 data from FR24 in Home Assistant
42 stars 5 forks source link

Map in Popup #3

Closed hugalafutro closed 2 years ago

hugalafutro commented 2 years ago

Hi, excellent card, I was wondering would it optionally be possible to also display map centred on the radar in the popup?

Though I'm not sure if it's possible to "cut" out just the map without the planes list, as when I go to http://[my fr24 ip]/dump1090/ I see both, which makes it fairly crowded with the limited screen estate on phone.

fratsloos commented 2 years ago

I like the idea of a map, in fact it was one of my first wishes for showing the results within HA. But it is not so easy to use a map based on the data from the JSON. See the documentation.

With regard to loading the map that can be found on your Dump1090 frontend: that is not possible either. The frontend of Dump1090 contains a lot of code that is needed to show the map and the list. Loading all this code into Home Assistant does not seem desirable to me. And using just a part (the map) of that page is also not possible, because it is dependent on each other. You'll have to stick to an iframe card loading the Dump1090 front-end if you want to use that map in HA.

I am thinking about using a static maps API in the popup. This could then replace the image of Planespotters, or it could be at the bottom of the popup.

With a static maps API a static image is generated (like any other image on the internet), so the plane will not move over the map like in the Dump1090 frontend. Also there are no map controls. The best known is the Google Maps Static API, but it does have some drawbacks:

A quick search for a static maps API based on OpenStreetMap also yields some results: https://wiki.openstreetmap.org/wiki/Static_map_images. I have to dig further into this.

I am also open to proposals for a different implementation. In that case, leave a comment, preferably with code examples and/or documentation.