Move the default ESRI world geocoder to the end of the list of sources for search

3260
4
Jump to solution
08-19-2015 08:58 AM
JssrRR
by
Occasional Contributor II

I am trying to move the ESRI world geocoder  to the bottom of my list sources for the search function, I believe the it is the first one in the sources array by default (Esri World Locator), as mentioned by Kelly Hutchins's Blog  in this thread,

https://community.esri.com/message/517562#517562

I have added four sources to the search function and I want to change the order so that ESRI world geocoder shows up at the end,

I tried this changing the number in the array,

sources: [4], it did not work

Any help or suggestions will be great!

Thanks

0 Kudos
1 Solution

Accepted Solutions
ChrisSmith7
Frequent Contributor

I wasn't successful, either, trying to load the source (commented-out code), but I did just reverse the array to show it's possible:

multiple sources example - world geocoder at the end - JSFiddle

View solution in original post

0 Kudos
4 Replies
ChrisSmith7
Frequent Contributor

Have a look at the following thread - Disable ESRI World Geocoder from Search Bar

I provided an example of how to remove the Esri World Geocoder - I believe you can just add the Esri world geocoder source at the end of the sources array and it should show-up in that order.

I'll see if I can put-together a jsfiddle...

JssrRR
by
Occasional Contributor II
   });
     sources.push({
    geocoder: new Geocoder("https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer"),
  singleLineFieldName: "Single Line Input",
  outFields: ["Addr_type"],
  name: "ESRI World Geocoder",
  autoComplete: true,  
            maxResults: 6,
            maxSuggestions: 6,
  //locator.outSpatialReference = map.spatialReference;
  //},
  placeholder: "Find a place or address",
           });


         //Set the sources above to the search widget
         s.set("sources", sources);


         s.startup();

I tried your suggestion, do I have it right?

because it is showing up in the drop down at the end of the list, but is not actually working.

Thanks.

0 Kudos
ChrisSmith7
Frequent Contributor

I wasn't successful, either, trying to load the source (commented-out code), but I did just reverse the array to show it's possible:

multiple sources example - world geocoder at the end - JSFiddle

0 Kudos
JssrRR
by
Occasional Contributor II

Chris,

Yes, that worked, thanks.

0 Kudos