Closed piercebb closed 4 years ago
Hi again!
Yes, I see what you mean. This does sound like a reasonable proposal. I want to thank you for filling out the issue template, this is a lot of really useful information! I have a full picture of what you mean and how you suggest it could be implemented.
No worries if you aren't, but are you thinking of implementing this yourself? Would you want someone else to pick it up? Either way is fine, just want to make sure two different implementations don't bump into each-other.
I am thinking of implementing this myself. Wanted to write out / get feedback on a proposed implementation before moving forward.
As you show in the GIF in your post, the restroom info panels do overlap a lot. So auto-closing old ones when a new one is clicked makes sense to me.
Any way you want to discuss code changes is okay. Posting "diffs", linking to commits on your fork of Refuge Restrooms on GitHub, opening a PR are all fine.
-- I see there is a PR now. I'll take a look at that.
Scope / difficulty
Difficulty: easy-medium Files to change:
maps.js.erb
Impact
Rationale
x
to close the info window every time.Proposal
These will prevent bathrooms from crowding the map and overlapping each other.
How to actually do this:
maps.js.erb
.infoWindows
when a marker is clicked. Probably add the logic in the existing on-click listener here.marker
has its own relativeinfoWindow
, as opposed to a globalinfoWindow
, I think the most recently opened window should be captured in a global variable as suggested here, and then closed as the new marker is selected.placeMarker()
function, so the correctinfoWindow
is closed.