Information Technology Reference
In-Depth Information
Figure 10-3 . Finding ferry transport with Move Me
Once again, we've found the transit options we sought. In this instance, you'll notice
several markers overlapping one location. This is Google's search returning the several
different ferry companies and ferry options that operate from that location, not a mistake
in the HTML or JavaScript we're using.
Improving the "Move Me" Example Application
By now, you will have noticed that the simplicity of our form actually becomes a little
cumbersome. Sure, your users could enter anything they like in their local search, but
maybe you'd like to save them the effort of typing on tiny soft-keyboards. The second
version of our example code, in the file ch10-example02.html , revamps the form code to
provide simple buttons for popular transit types, and invokes our modified execSearch()
function. Our new form is coded as follows.
<div style="width: 330px;">
<input type="button" value="Subway" onclick="execSearch('BART station')"/>
<input type="button" value="Train" onclick="execSearch('train station')"/>
<input type="button" value="Bus" onclick="execSearch('bus stop')"/>
<input type="button" value="Ferry" onclick="execSearch('ferry terminal')"/>
<div style="position: absolute; left: 440px;">
 
Search WWH ::




Custom Search