USGS-WiM / whispers

Wildlife Health Information Sharing Partnership event reporting system(WHISPers) v2
Other
2 stars 1 forks source link

home page map not accounting for legend when displaying dots #1299

Closed JChipault closed 1 year ago

JChipault commented 1 year ago

Describe the bug There are event dots on the home page map that are under the legend. I think when we decided to default the legend to open, that we worked on re-centering the dots such that the legend was taken in to account. This might have been something done when Marcus from SGCI was helping us.

To Reproduce Steps to reproduce the behavior:

  1. Go to test site
  2. Default search loads
  3. Notice that some events are under the legend: image

Expected behavior Event dots are centered after taking in to account the width of the legend. This is working as expected on the live site; screenshot of expected behavior here- image

Maybe this has been off on the test site for a while and I just hadn't noticed it before now?? It's strange to me that this is off on the test site and fine on the live site.

BlakeDraper commented 1 year ago

@JChipault our options are somewhat limited here given our mapping library Leaflet. The offset stuff is a but finicky in combination with the function that dynamically parses the bounds of the displayed dots. In my experimentation, I could only get it to go a little overboard with the offset. If this is a must-fix, due to the time involved in tracking down a better solution, I am going to have to punt on it for now until we have a more solid plan in place for development this year.

JChipault commented 1 year ago

@BlakeDraper Ok, I was thinking this would be just a quick thing to double-check on the test site code because it seems to be working as expected on the live site. So seems something just got reversed on the test site (or maybe the test site has been off and I just haven't noticed before?). I think this adjustment to account for the open legend was something Marcus worked on so perhaps it's in his code? Anyway, agree, no need to spend a lot of time on it now if it's not a quick fix, but I just wanted to make sure my message was clear that it's working as expected on the live site currently.

BlakeDraper commented 1 year ago

@JChipault nothing was reversed. The way our code and code reviews work its very rare for something to be simply reversed (but not saying it's impossible!). Are you comparing the same query and data across both test and production? Being different databases would make that difficult, but maybe you have duplicated something in the test DB from production?

If not, I suspect you may be seeing a subtle difference in how the same exact function in being applied to different data. The function is not as specific as "move the map such that no dots appear under the legend" but more - "re-center and apply a reasonable offset to minimize the issue".

JChipault commented 1 year ago

ok, I did some more playing around and we can just ignore this ticket. I can't recreate it on the live site but I also see that it doesn't consistently happen on the test site so, like you said, seems just an oddity of certain groups of dots. Not worth spending any more time on.