I migarate from 4.11 to 4.12, after migration my search widget can not auto navigate to results!! why?
Like Kelly said, this is a bug on our side and we'll work on a fix for 4.13. In the meantime a possible workaround is to add the layer to the map like Kelly suggested.
Hi
When I use search widget it return this error in browser console:
[esri.views.3d.state.ViewStateManager] #goTo() Failed to create camera from target, no layerview has been found for the layer
I think arcgis java script 4.12 has too many bugs!! There is not any solution??
I,m working on 3d view, but your sample is on 2d. I tested your code with my sample and can not zoom on results! why?
autoNavigate is true by default so you shouldn't have to set it if you want true. I tested both true and false using this sample and got the expected behavior in both 4.11 and 4.12.
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=widgets-search-multiplesource
var searchWidget = new Search({
view: view,
allPlaceholder: "search...",
sources: [{ layer: new FeatureLayer({ url: "localhost:6080/arcgis/rest/services/city/FeatureServer/0", outFields: ["*"], }), searchFields: ["city"], displayField: "city", exactMatch: false, outFields: ["city", "local"], name: "city1", placeholder: "search city...",
autoNavigate: true,
maxResults:10, maxSuggestions:50,
enableSuggestions: true },
By default autoSelect is enabled and the search will select and zoom to the first geocoded result. It works in the sample: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=widgets-search-3d
Do you have a reproducible bit of code that shows what you are seeing?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.