esridc / openfda

Demonstration of Agile Process
http://esridc.github.io/openfda/
Apache License 2.0
3 stars 6 forks source link

Locator should restrict results to the US #45

Open ajturner opened 9 years ago

ajturner commented 9 years ago

If I type in my zipcode 20002, 4 of the 5 suggestions are outside the US and therefore not useful

The locator should support bounding-box restricted suggest & responses.

open_fda

benheb commented 9 years ago

@ajturner any idea how to do this? Am I missing the option to restrict results to U.S. here? https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html

benheb commented 9 years ago

@ajturner I just am not seeing this as an option for the GeoSearch control I am using for this app. I see it as an option for the geocoder, but that's not helpful here. I think we may need to close this bug as 'wontfix' if that's okay with you.

Docs: https://github.com/Esri/esri-leaflet-geocoder#lesrigeocodingcontrolsgeosearch

ajturner commented 9 years ago

@benheb the specific option of country likely is not exposed in the library, but is available in the underlying API. That would mean submitting a patch back to the project.

About here you would add something like this plus other stuff through the library :)

    if(country){
      request.sourceCountry(country);
    }

You could use useMapBounds : true.

if not - just backlog for now.

ajturner commented 9 years ago

added Feature Request

benheb commented 9 years ago

@ajturner yea I have useMapBounds set to true, and doesn't seem to do much, except maybe favors US results first, but still shows results outside of view. Backlog seems good on this one.

gclancy commented 9 years ago

Agreed - move to backlog.

jgravois commented 9 years ago

i assume you guys are using esri leaflet geocoder rc.4?

if so, feel free to compile master from source as i patched this in Esri/esri-leaflet-geocoder/pull/58 shortly after we tagged our last release.