kasugaijin / baja-pet-rescue

Kasugaijin's open-source Ruby on Rails production app that enables dog rescue organisation staff in Mexico to post dogs and receive applications for adoption from users in USA and Canada..
27 stars 9 forks source link

Clickable pins and random values to locations #158

Closed egemen-dev closed 1 year ago

egemen-dev commented 1 year ago

I copied the repo and got it running on my local environment to experiment adding clickable pins and meta data. Here is the preview. I might open a PR after this. https://github.com/kasugaijin/baja-pet-rescue/issues/144 Screenshot 2023-06-11 at 14-11-15 BajaPetRescue


My question is, the reason to apply random values to the duplicate locations (https://github.com/kasugaijin/baja-pet-rescue/issues/134) because if the same person adopted multiple pets it's nearly impossible to individually display them on the map - they overlay each other, is that right or something else? @kasugaijin

luuu-xu commented 1 year ago

Hi, just stumbled upon your issue, I would like to guide you towards solving this with Google Maps' Marker Cluster feature. I have encountered this same issue on my risk-viz project. Only using marker cluster would not be enough since if you have multiple markers at the exact same location, Google Maps wouldn't show them all. In the end I used marker cluster, with a helper function which adds a little bit of variance to the lat,long data so it shows up perfectly. Hope it helps!

kasugaijin commented 1 year ago

Hey @egemen-dev thank you for opening this. This would be a great addition.

There's a couple of related issues, as you have pointed out. They should be done in this sequence:

I like the idea of @luuu-xu solution using clusters...but I don't think we need to do that just yet. Perhaps that can come in another issue once the map starts to look very busy.

Let me know if you want to tackle all of this. If you have any questions I am happy to discuss.

kasugaijin commented 1 year ago

This PR now merged: https://github.com/kasugaijin/baja-pet-rescue/pull/160 So this issue is now unblocked and we can add meta data to dog pins. See my comment on the PR.

Thanks

kasugaijin commented 1 year ago

Closed.