Adding Tools to a Map
- Currently this is basically the code to a working example with lots of comments. I will try to add more explanation as time allows-Casson*
I do not know how global the distinction is, but in ESRI products (ArcView) they make a clear distinction between buttons and tools.
Buttons can be the equivilant of menu items. More importantly when you click on a button it does its task.
Tools on the other hand simply set up some condition when pressed. The actual work takes place when the user clicks on the map itself. The information from the click is used to carry out the tools function (i.e., zoom in on the clicked point).
This example has both buttons and tools.
- Button Functions
- Reset: sets the visible area to the full extent of the layers.
- Left: moves the view to the left (West).
- Right: moves the view to the Right (East).
- Up: moves the view up (North).
- Down: moves the view down (South).
- Tool Functions
- Zoom To Point: zooms the view and centers on clicked point.
- Zoom Out From Point: zooms out centered on the clicked point.
- Get Feature: returns a single feature under a user's click or zooms to the area if more than one feature is selected. The selected feature is "highlighted."