Book Image

ArcGIS By Example

By : Hussein Nasser
Book Image

ArcGIS By Example

By: Hussein Nasser

Overview of this book

Table of Contents (17 chapters)
ArcGIS By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Filtering restaurants on the map


This is the last section in this chapter. We learn how to filter the map to display only desired venues. We will apply this filter on the category selection, for instance, when I select Cafe's, only cafes will be displayed on the map, and so on. Follow these steps to do so:

  1. If necessary, open Visual Studio Express in Administrator mode; we need to do this since our project is actually writing to the registry this time, so it needs administrator permissions. To do that, right-click on Visual Studio and click on Run as administrator.

  2. Go to File | Open Project, browse to the Bestaurants project from the C:\ArcGISByExample\bestaurants\Code, and click on Open.

  3. Right-click on frmRestaurantsViewer.vb and select View Code.

  4. In the cmbCategory_SelectedIndexChanged method, scroll to the end of the method and add the following code to get the layer and set the definition query of the layer, so that we only display the currently selected category:

      Private Sub cmbCategory_SelectedIndexChanged...