Is it possible to use the search widget with a different geocoder instead of the one suggested by Esri? I have an address search API, but I don't know whether is is supported?
Be sure to set the includedefaultsources to false
var searchWidget = new Search({view: view,allPlaceholder: "Search by street address",autoSelect: true,suggestionsEnabled: true,includeDefaultSources: false,sources: [{locator: new Locator({//url: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer" //World GeocodeServerurl: "your GeocodeServer"}),name: "City Locator",placeholder: "Street Address",zoomScale: 1000},]})
Yes, the Search widget can work with the default Esri World Geocoder, with a layer, with a geocode service resource exposed by the ArcGIS Server REST API, or a properly configured 3rd party search API.
Search widget with a custom source (open data address search API for France)
https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-customsource/index.html
Search widget with multiple sources (2 layers and Esri World Geocoder)
https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/index.html
Yes. I think geocode services are configured like normal with the sources property.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.