Information Technology Reference
In-Depth Information
Our modified execSearch() function no longer needs to read from a text field, largely
because we've removed it! Instead, it takes as a parameter the text we pass in when we
call the function, such as "train station" or "ferry terminal,” and invokes execution of the
relevant search.
function execSearch(searchText) {
myLocalSearch.execute(searchText);
}
Our application now looks a little more instantly usable, with relevant buttons for
Subway, Train, Bus, and so forth, as shown in Figure 10-4.
Figure 10-4 . Move Me application with dedicated transit buttons
From here, pressing a button produces results as before, obviously tailored to match the
criteria coded for each of those buttons.
Dealing with Other Transport Possibilities
There are countless ways you could take this example further. One obvious example is
to expand the number of buttons for transit options. You could include taxis, airports,
trams, and more. There are other nuances to consider as well. The subway in San
Francisco can mean the BART system, but much of the Muni system is also considered
a subway. In other cities, the subway has other names, such as "Underground" in
 
Search WWH ::




Custom Search