Hi
I,m using search widget in 3d view by 4.6 version , but I can not use my feature service!! why? this is my sample:
var search = new Search({ sources: [{ featureLayer: new FeatureLayer("https://services.arcgis.com/b6gLrKHqgkQb393u/arcgis/rest/services/TaxParcelQuery/FeatureServer/0", { outFields: ["*"], infoTemplate: new InfoTemplate("Parcels", "Owner name: ${OWNERNME1}</br>Parcel ID: ${PARCELID}</br>Site address: ${SITEADDRESS}") }), outFields: ["OWNERNME1","PARCELID","SITEADDRESS"], displayField: "OWNERNME1", suggestionTemplate: "${PARCELID}: ${SITEADDRESS}", name: "Parcels", placeholder: "example: Shawn Smith", enableSuggestions: true }], view: view }, "search"); search.startup();
Anjelina,
This is becoming a little frustrating. You need to slow down and look at what I am saying. In your code above where is the "searchWidget" div in your html code?
So you need a div called "searchWidget".
You still are ignoring my recommendation
For some reason you still have the above trailing comma and proceeding properties
even though I mentioned this before.
var searchWidget = new Search({
sources: [{
featureLayer: new FeatureLayer("http://localhost/arcgis/rest/services/city_denver/FeatureServer/0", {
outFields: ["*"], //<--- REMOVE THIS COMMA
}),
Next would be a question, the basemaps you are using that only cover a small portion of the globe so what use is it to use a sceneview / 3D map?.. Visually your sceneview looks horrible. Even when I click on your "new base map" check box, is this really something you would use and show to people?
I am on local (Interanet)
this sample is just to show problem for you
did you test your suggest? I tested it and no result!!! why?
var searchWidget = new Search({
sources: [{
featureLayer: new FeatureLayer("http://localhost/arcgis/rest/services/city_denver/FeatureServer/0", {
outFields: ["*"]
}),
outFields: ["name","town"],
displayField: "name",
searchFields: ["name"],
name: "name",
placeholder: "example: denver",
exactMatch: false,
zoomScale:10000,
maxResults:6,
maxSuggestions:6,
autoNavigate: true,
enableSuggestions: true
}],
view: view
}, "searchWidget");
view.ui.add(searchWidget, {
position: "top-left"
});
});
</script>
</head>
<body>
<div id="searchWidget" style="direction:rtl"></div>
<div id="viewDiv"></div>
<span id="layerToggle">
<input type="checkbox" id="streetsLyr"> new base map
</span>
</body>
</html>
I did test and the search widget shows up just fine, but does not add a zoom or add a marker or popup.
When I remove the ground layer you are using then the search works fine. I am not sure what the issue is but your dem layer is a problem.
my code is based on bellow link:
Custom ElevationLayer - Exaggerating elevation | ArcGIS API for JavaScript 4.6
One thing I can tell you is that the dem_denver (ImageServer)'s extent looks wrong:
Extent:
XMin: -1.1688638799535032E7
YMin: 4163840.6119491374
XMax: -1.1131948579326335E7
YMax: 4866018.920541309
Spatial Reference: 102100 (3857)
no its not related to extent. I have another dem layer that it's extent has not this problem but serach widget can not add marker and zoom to
Anjelina,
The search widget does not seem to work when using the custom Exaggerated elevation. I tested now using their url (from the sample) and it does not work either. So this sounds like a API limitation.
how we can be sure about this?
If you were a US customer you could call esri tech support. But in your case you have to contact your local esri office.