Closed tomay closed 1 year ago
Leaflet/Carto.js uses Javascript to position the popup every time it opens, so simple CSS positioning hacks alone won't work
We could create the popup from scratch, but that also means we have to rewrite any and all methods in place to track and respond to popup state, like on('popupclose')
and on('popupopen')
I was able to hack the existing position. Seems to be working fine so far, but we should continue testing:
Unfortunately, I cannot easily move the zoom controls to the top left, because the sidebar overlaps the map, and this overlap is not consistent (sometimes less, sometimes more). With additional time, that could also be tracked down and fixed...
Mike would like for the map to center on the selected building.
At the moment, it seems like Leaflet/Carto is attempting to "auto pan" the map so that the popup stays in the viewport, even though that is no longer necessary, which might complicate this.
~I did see that the Leaflet option autoPan: false
doesn't have any effect (could be a newer Leaflet option that is not present in cartodb.js
)~ I must have been doing this wrong - it works
Auto pan, then center might not be great, but we can try and see how that works.
Done and deployed
Building map popup is blocking the clicked building. Can it move to the right side of the screen?