I am new to JS and I don't quite know how to integrate the Zoom to Layer functionality in my code snippet. I have tried several ways and have failed. Any pointers would be very much appreciated.
I assume the zoomToLayer function must be added when the query geometry is returned by the queryForWellGeometries() function.
The complete code can be found here -> https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=featurelayer-query and zoomToLayer() code can be found here -> https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=featurelayer-queryextent
When the option is selected from the dropdown menu, it would be useful to zoom to the extent of the queried feature. Right now, the code works but it does not zoom to the feature.
I have tried all sorts of permutations but because my knowledge is basic, I feel I am missing a link.