Hey everyone, I am using the search widget with custom source to allow users to look up different parts of the 3D diagram. Elevation offset has been applied onto the diagram via ArcGIS Online portal to be higher than it's default(underground) location.
Upon completion of the search, it would still automatically redirect the user to it's default(underground) location as opposed to the elevated position.
This is what I have tried so far,
var map = new WebScene({
portalItem: {
id: "xxx"
}
});
var view = new SceneView({
container: "viewDiv",
map: map
});
var searchWidget = new Search({
view: view,
autoNavigate: false,
autoSelect: false,
sources: [{
name: "Stations",
layer: new FeatureLayer({
url: 'xxx.com/server/rest/services/Hosted/Stations/FeatureServer/0',
outFields: ["assetID"]
}),
searchFields: ["assetID"],
displayField: "assetID"
}]
});
view.ui.add(searchWidget, "top-right");
searchWidget.on("search-complete", function (event) {
event.results[0].results[0].feature.sourceLayer.queryFeatures(
{
objectIds: [event.results[0].results[0].feature.attributes.objectid_1],
outFields: ["*"],
where: "1=1"
}
).then(functions(res) {
view.goTo(res.features)
});
});
With the given code above, the map doesn't move at all after selecting the search result. I have tried checking on "select-result" as well.
Am I doing something wrong or is there any other way I could redirect the search result to the appropriate 3D diagram and its location? Would greatly appreciate any help I could get. Thanks in advance!