I'm building an python dash-leaflet app where the user can click on a map to place a rectangle through a callback, and I would like to add a second callback (bond to a slider) to rotate it around its center according to North (eg. rotate it by 20° to the East).
To place the rectangle in a callback I use:
mapOne.append(dl.Rectangle(fillOpacity=0.5, weight=0.7, color='#888',
bounds=[[click_lat_lng[0]+xbox1, click_lat_lng[1]+ybox1],
[click_lat_lng[0]+xbox2, click_lat_lng[1]+ybox2]]
))
I thought about a sort of inverse Haversine function to get the new "rotated" xbox1
and xbox2
, but the dl.Rectangle()
seem to be always aligned with axes.
Any thought on the best way to achieve this?