Can we write the code for button click to zoom to a particular location on web map using webapp builder widget? If yes, please share the code snippet.
Thanks in advance
Sure widgets support button and map actions. I threw together a sample to give you a jump start. One of the best ways to learn widget development is to look at code in existing widgets.
There are several resources you can use to get started building your own widget.
Create a custom in-panel widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
Welcome—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
Re: Builder and stemapp. Custom widget workflows.
But I don't see any button click event written in those link for zooming on map.
Thanks for reply Robert
Well you have to start some where and the first step is to know how to create a custom widget. Then you would add you custom functionality to the widget. Adding a button is simple JS skill you will need to learn if you are going to be developing widgets for WAB. Are you wanting to zoom to a map point or an extent. Where is this location coming from, something hard coded?
Thanks Robert for quick tag.
I created custom widget suggested by ESRI WAB help and added button & its event but after deployment it is not functioning so question arises whether widgets supports button event & map actions? I was not able to find such code so suspected am i on right track?
Also through REST API I got geometry(point) as per my business rule where I want to zoom. It has to trigger by user by clicking "zoom" button on the widget.
Many Thanks. The shared sample helped me a lot.
Retrieving data ...