Is there a way to set the geocoder widget to default on the searchable layer upon open? Or is there already a downloadable widget somewhere that allows me to search layers and the geocoder at the same time?
Hi Adam,
here is one way to modify this in the widget's .js code:
Line 199 in [...]\arcgis-web-appbuilder-1.1\server\apps\[...]\widgets\Geocoder\Widget.js
//geocoding widget original configuration: geocoding service is default, feature layer search is secondary choice.
this.config.geocoder.geocoders = this.config.geocoder.geocoders.concat(querys);
//geocoding widget will only contain the feature layer search.
this.config.geocoder.geocoders = querys;
//geocoding widget will contain both geocoder + feature layer search and will default to feature layer search.
this.config.geocoder.geocoders = querys.concat(this.config.geocoder.geocoders);
If you want to search features, you need to add a query type geocoder object to config.geocoder.geocoders.
The next release will use search widget replace Geocoder, so users could set searchable layer in setting page.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.