Book Image

Building Web Applications with ArcGIS

By : Hussein Nasser
Book Image

Building Web Applications with ArcGIS

By: Hussein Nasser

Overview of this book

Table of Contents (13 chapters)

Using definition query to filter map


After we have added the identify feature on our web application, it is time to add some filters. We will start by filtering the map by category and rating. The user will select a category, say the Café category, and the map should be updated to show only café. This is where we will use the upper toolbar.

Filtering by category

First, we will need to add the necessary control for the filter that will assist the user to a query. If you referred to our interface design that was covered in Chapter 1, The Bestaurants Project, you will notice that we can use a drop-down list for the categories and as the user changes; we will update our feature layer.

As a programmer, you should know that if we are planning to make changes to an object on runtime, it should be set as modular and that's what we will do. This can be achieved by moving the var lyr_foodanddrinks variable above the startup function and update the assignment.

Tip

lyr_foodanddrinks is a global scope variable...