Places of interest misbehaving when using circle drawing tool

Platform (Website):
Browser, if a website issue ( Chrome,) :
https://www.inaturalist.org/observations?lat=-33.9414566667&lng=18.5654233333&locale=en-GB&order_by=observed_on&place_id=any&preferred_place_id=113055&radius=0.050&subview=map&ttl=-1

Places of interest is repeating same place and summarizing in unrequested script. Both Standard and community are identical

2 Likes

It is related to the circular drawing tool. Zooming, redo search in map, and the draw rectangular box all work as expected.

2 Likes

yup.

when you have a circular custom boundary, the system tries to make this kind of request to get nearby places: https://api.inaturalist.org/v1/places/nearby?lat=-33.94003467347731&lng=18.56328079942614

otherwise, the system makes a request like this to get nearby places: https://api.inaturalist.org/v1/places/nearby?swlat=-33.942707121456834&swlng=18.56286505702883&nelat=-33.94025942045999&nelng=18.56864789966494&lat=-33.94148327975541&lng=18.565059104003012

in the circular boundary case, lat and lng are unrecognized parameters for that API endpoint. so you’re getting the same nonsense results as you would get if you didn’t specify a search area: https://api.inaturalist.org/v1/places/nearby.

a note for developers looking at this: is there a reason that the nearby places request is made any time the map view changes? seems like it would make more sense to do this only when the Places of Interest button is actually clicked.

(it seems like the request is relatively slow and takes a couple of seconds to return an answer, and maybe the background loading is an attempt to make the page seem more responsive when clicking the Places of Interest button? but it seems like clicking the button would be a relatively uncommon activity. so all those background requests seem like they would just be eating processing time.)

2 Likes

Thanks, I made an issue: https://github.com/inaturalist/inaturalist/issues/3769

1 Like

This has been fixed. Here’s a random spot in western Africa I zoomed in on and used the circle drawing tool for:

1 Like

great. it looks like the unnecessary nearby places requests have been eliminated, too.

1 Like

This topic was automatically closed after 15 hours. New replies are no longer allowed.