Esri / arcgis-dijit-geocoder-js

JavaScript auto-complete widget for locating places.
Apache License 2.0
27 stars 19 forks source link

suffix prevents suggested locations from being zoomed to when selected #1

Open tomasz-zatorski-phe opened 10 years ago

tomasz-zatorski-phe commented 10 years ago

Hi there,

I came across a problem with the Geocoder when trying to limit the set of returned suggestions in terms of the source country.

In my case, I would like the Geocoder to return only locations within the United Kingdom. Because of that I tried setting the 'sourceCountry' parameter to 'GBR' but that didn't make a difference. For example, when typing in 'Newport' there are 4 US locations and 1 UK location where the UK one is third in the list.

I then tried using the parameter 'suffix' and set it to ' GBR'. This solved the problem with the accuracy of the suggestions as now they all come from the UK.

However, only suggested locations for towns and postcode lookups work when the 'suffix' parameter is used. When I try to lookup a more specific address starting with a road name, I get the correct list of suggestions but when I click on any of them, nothing happens. To add to the confusion when I delete the 'GBR' suffix from a specific address suggestion, the map zooms in to an expected location.

I and my team would be really grateful if you could look into that. Especially into why the sourceCountry parameter doesn't limit the suggestions to the specified country and why the suffix parameter breaks specific address lookups.

Below my Geocoder init:

            var geocoder = new Geocoder({
                map: map,
                autoComplete: true,
                arcgisGeocoder: {
                    name: "Esri World Geocoder",
                    sourceCountry: "GBR",
                    suffix:" GBR",
                    placeholder: "Search for location ... ",
                    localSearchOptions: {
                        minScale: 0
                    }
                }
            }, "search");

Thanks a lot, Tomasz

driskull commented 10 years ago

Hello, we are working to add that support for the locator suggest API. Thanks for your feedback!

Sorry for the late response, I wasn't notified of the issue.

jamesSampica commented 10 years ago

@driskull Any update on this? SourceCountry still doesn't work in 3.10

driskull commented 10 years ago

hey @shoe788 , It's still in the works. Development is aware of it. Thanks for the feedback

jgravois commented 9 years ago

fyi, this is supposed to drop quite soon.