Geocoder: Default on Layer Search or Multiple Search?

3055
2
Jump to solution
06-24-2015 11:42 AM
AdamAraza1
New Contributor II

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?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
TobiasFimpel1
Occasional Contributor III

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);

View solution in original post

2 Replies
TobiasFimpel1
Occasional Contributor III

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);

ZeZhengLi
Esri Contributor

Hi Adam,

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.

0 Kudos