Creating a custom button
You know a bit more about the Button class now, so let's put that knowledge to use. We'll create a fairly simple custom button (of control type TYPE_BUTTON
) that will update the base layer's opacity and zoom the map to a random spot. We'll cover the few basic things that should be included when creating a button:
Specifying the button's
displayClass
to give it style (optional)Creating a function and setting it as the trigger function
Adding the button a panel, and then adding that panel to a map