S
Solara4mo ago
Stefan

Need help with ipyleaflet

Hello, I am trying to design a map in ipyleaflet and need some help. I am currently working on the compass, to help people in finding the correct azimuth (orientation) of their solar arrays (inspired by: https://osmcompass.com/) This is what I currently have: https://github.com/Open-HEMS/pvcast-frontend/blob/solara/pvcastfrontend/02-config.py#L850 I'm trying to implement the following things now: - Stylise the compass. It's kinda ugly - Add north/south/east/west indicators and/or degree indicators to the circle - Add a widget in the top right corner to display the azimuth I find the documentation of ipyleaflet (not solara) lacking. It's maybe doable for experts but this is my first frontend project, and there are only a few examples that do very simple things. I would be very grateful if you could point me to some examples of how to built the things in my list.
5 Replies
Monty Python
Monty Python4mo ago
pvcastfrontend/02-config.py line 850
class Compass(leaf.Marker):
class Compass(leaf.Marker):
Corran
Corran4mo ago
Could you replace the circle with an image? https://ipyleaflet.readthedocs.io/en/latest/layers/image_video_overlay.html Im not sure if the images support rotation though if you needed to rotate the map and have the compass rotate too
Stefan
Stefan4mo ago
I tried that, but the browser will block locally loaded content from being displayed. It has to be hosted somewhere and I dont want to do that
Corran
Corran4mo ago
Ah hrm, thats frustrating
Stefan
Stefan4mo ago
hoping somebody with expertise in ipywidgets could give some tips