Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of addresses shown in map #114

Open
joshsmith opened this issue Jan 9, 2016 · 2 comments
Open

Limit number of addresses shown in map #114

joshsmith opened this issue Jan 9, 2016 · 2 comments
Labels

Comments

@joshsmith
Copy link
Contributor

The UX for this hasn't been thought through very well, but we should try to limit the max number of addresses returned by the API. I don't believe there's a limit right now. It should probably try to show the nearest to an address first, or try spreading them out in a region.

@joshsmith
Copy link
Contributor Author

This is a really huge issue, actually. Even though I appear to have resolved the 503 errors in most cases, the requests are still extraordinarily slow.

According to geokit-rails we can do:

def closest(options = {})
  geo_scope(options).order("#{distance_column_name} asc").limit(1)
end

In addresses controller we'll need to change .within to use .closest that simply calls within instead of geoscope with an order and limit.

@joshsmith
Copy link
Contributor Author

Given that it's bugging out on just 400 of these records, we might want to limit to just 100.

@joshsmith joshsmith added the bug label Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant