ternandsparrow / wild-orchid-watch-pwa

Progressive Web App for the Wild Orchid Watch citizen science project
https://app.wildorchidwatch.org
4 stars 4 forks source link

Add option to choose geolocation by dragging a pin on a map #95

Closed sbbu closed 2 years ago

sbbu commented 2 years ago

As requested in Issue https://github.com/ternandsparrow/wild-orchid-watch-pwa/issues/19

tomsaleeba commented 2 years ago

Hey Jeremy, thanks for getting to this so quickly. It's looking great, I just need you to fix one bug.

The bug

https://user-images.githubusercontent.com/1773838/160924889-c6fda288-be8d-47cf-bb38-225de8788043.mp4

Steps:

Expected: The location for the observation is updated and I can see that in the map on the view (as opposed to edit) page.

Actual: The observation is updated with null for the coords. Actually, it's updated to be whatever location you selected last time. If you repeat the steps a second time, you'll see the location is updated, but to what you set on the first edit, not the second.

Hint on how to fix it.

I'll admit, coming back to this code with fresh eyes, that it's a bit weird how it works. I guess I had a good reason to build it like this the first time.

Extra feature request

This is scope creep, sorry :grimacing:. Could you add code to default to using the existing coords for the observation if it has some (which it should when editing). For a new observation, your current logic of picking a spot in Adelaide is great :+1:

sbbu commented 2 years ago

Hey Tom, thanks for the detailed explanation of the bug and the hint for fixing it. I've fixed that and added the extra feature to initialise the marker to existing observation coords when editing 🙂. Let me know if there's anything else.

tomsaleeba commented 2 years ago

@j-robinson it's perfect :ok_hand: thank you!