this is my code kindly help me out
//searchwidget start
const searchWidget = new Search({
view: view,
locationEnabled: true,
includeDefaultSources: false,
allPlaceholder: "Search Location...",
sources: [{
locator: new Locator({ url: "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"}),
countryCode:"US",
categories:["Address" ,"Postal"],
extent: {xmin:"-97.610790582999954", ymin:" 42.938855766000046", xmax:"-90.790790582999961", ymax:"49.758855766000039"},
"spatialReference": {
"wkid": 4326
},
singleLineFieldName: "SingleLine",
outFields: ["State", "Addr_type"],
suffix: ",Minnesota,MN,USA",
filter: {where: "State = 'Minnesota'"},
maxResults: 10,
maxSuggestions: 5,
suggestionsEnabled: true,
minSuggestCharacters: 4,
placeholder:"Find address"
}]
});
I'm not sure here, as I tested your code and it appears to work fine:
https://codepen.io/noash/pen/jOWMwEm
Here are a couple resources I looked at, there are things I would change about your code, but I'm not sure that there is an issue here.
How To: Limit geocoding results to a specific area
How To: Limit geocoding results to a specific area
World Geocoder for ArcGIS - FAQ
https://www.esri.com/~/media/Files/Pdfs/data/esri_data/pdfs/world-geocoder-faqs.pdf
Thanks for the reply,
if you type wisconsin it will show results from wisconsin state that should not be the case what ever i type it should filter results only from minnesota state.
even i used the search-extent to specific rings am experiencing the same issue
Let me look into the other links which you have given
However, when typing in places that you'd expect to see in Wisconsin (Madison, Milwaukee, etc), the widget only presents locations in Minnesota.
yes its taking the suffix and displaying the result, there is no use of filter statement even if you hide the statement it is filtering result based on the suffix given, do we have any specific code for this issue??
Your View is not filtered. Try adding a view filter – some code examples are here
https://developers.arcgis.com/labs/javascript/filter-a-feature-layer/
Sure Will try that