I'm using app studio and I would like to add the buttons to the map for GPS/zoomin/zoom out (see attachment). The screen shot was taken from an app built using the mapveiwer template. I've been scanning the code for that template but I don't see any particular lines that would be inserting these buttons. Is this built into the map api? Anyone have any idea?
Do a global search in the project for the text "ZoomButtons" and you should find the object. I believe it is a custom object created by the AppStudio team, so you can go into it and customize it a little, e.g. change icons etc.
If you want to use the object in your own app, make sure you have this import statement:
import ArcGIS.AppFramework.Runtime.Controls 1.0
then just add the object and go from there...
Thanks Paul. I came across someone else talking about ZoomButtons in another thread but when I search for the object in the code it comes up with no matches. Have you used this object before?
I don't have such a file in the project. There's a webmap.js file but no webmap.qml. Are we talking about the same code base? I'm referring to this mapviewer https://www.arcgis.com/home/item.html?id=0faea839dea644e688da36bccae87aa8
The zoom buttons are a component in AppFramework.Runtime.Controls.
The simplest example of this component in use, is the Hello World (Runtime) starter template. In this example the qml used to define the buttons is this: