James,
I don't have any code available off top hand - I know that's the service that is called by default. Well, "find candidates" is, at least. You can set sources:
Search | API Reference | ArcGIS API for JavaScript
I think you should be able to set it to the Esri default world geocoder as a source yourself, and then set the "searchExtent" property on the source object, kinda like so:
var extent = new esri.geometry.Extent({
"xmin":-81.465144,"ymin":26.949436,"xmax":-83.465144,"ymax":28.949436,
"spatialReference":{"wkid":4326}
});
var sources = [
{
locator: ,
singleLineFieldName: "SingleLine",
name: "Custom Geocoding Service",
localSearchOptions: {
minScale: 300000,
distance: 50000
},
placeholder: "Search Geocoder",
maxResults: 3,
maxSuggestions: 6,
enableSuggestions: false,
minCharacters: 0
}, {
featureLayer: new FeatureLayer("http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_Senators/FeatureServer/0"),
searchFields: ["Name", "Party"],
suggestionTemplate: "${Name}, Party: ${Party}",
exactMatch: false,
outFields: ["*"],
name: "Senators",
labelSymbol: textSymbol,
placeholder: "Senator name",
maxResults: 6,
maxSuggestions: 6,
enableSuggestions: true,
minCharacters: 0
},
{
featureLayer: new FeatureLayer(),{
outFields: ["*"]
});
placeholder: "esri",
name: "A FeatureLayer",
prefix: "",
suffix: "",
maxResults: 1,
maxSuggestions: 6,
searchExtent: extent,
exactMatch: false,
searchFields: [], // defaults to FeatureLayer.displayField
displayField: "", // defaults to FeatureLayer.displayField
labelSymbol: new TextSymbol(),
minCharacters: 0
}
];
We know it's supported, at least in theory, by the service link I posted. I'll have to look into creating a sample app when I get a free moment.