All, I'm trying to get the Search multiple sources | ArcGIS API for JavaScript sample to work, not sure why when I choose my search source, nothing happens..
- my search source is a point feature layer on an external server:
https://gisprod.dpsk12.org/arcgis/rest/services/address_master/FeatureServer/0
My code looks like this:
sources.push({featureLayer: new FeatureLayer("https://gisprod.dpsk12.org/arcgis/rest/services/address_master/FeatureServer/0"), searchFields: ["ADDRESS"], displayField: "ADDRESS", exactMatch: false, outFields: ["*"], name: "DPS Address", placeholder: "123 Smith St", maxResults: 6, maxSuggestions: 6, //Create an InfoTemplate and include three fields infoTemplate: new InfoTemplate("Address: ${ADDRESS}"), enableSuggestions: true, minCharacters: 0 });
(I have also attached the html file I'm working on.)
Which looks good to me.
But when I use *just* my source, or use *all sources*, no network traffic is generated for my source when input text is entered - but I can see the traffic generated for the other sources (ESRI World Geocoder and Congressional Districts) I've left in the app.
The only thing I can figure is I haven't added feature templates, but hoping that isn't required...?
Thank you!
Solved! Go to Solution.
If you're searching on attributes, as opposed to geocoding, the service has to be authored in version 10.3. It looks to me like you're searching in the data for an address, but not necessarily geocoding?
Matthew,
I got it to work with your code. I searched and found 19951 E 59th Dr using only your service. I could not get your search to work with ALL selected though.
Really? I can't get it to fire at all...
I did not change your code at all.
If you're searching on attributes, as opposed to geocoding, the service has to be authored in version 10.3. It looks to me like you're searching in the data for an address, but not necessarily geocoding?
Right - not geocoding, searching for an existing address then leaning on the ESRI geocoder for anything not in our file...
I hope that 10.3 stipulation isn't the hangup... we have no plans to upgrade any time soon...
It's not real clear in the documentation, but it does tell you in the API help for Search that it requires 10.3.
Suggestions are available if working with a 10.3 geocoding service that has suggest
capability loaded or a 10.3 feature layer that supports pagination, i.e. supportsPagination = true
.
It seems like when I looked into this, 'supportsPagination' is only available starting at 10.3 and not something you can create in the earlier versions. I'm not crazy about having to upgrade either, but this is the sort of functionality that makes me want to do it sooner rather than later. Thankfully the upgrade process isn't quite as painful as it used to be.
I'll have to roll with that for now... thank you!!!