Let's add some more interaction to our map now. We'll add an input box that will change the requested Flickr data based on the user's input.
Open up the previous example, we'll be adding to it. First, we'll need to add an input box and button to the HTML page. We'll create a div that holds them and place it right next to the map. Right after the map div, add the following:
<div id='input_wrapper' style='position:absolute; left:610px; top:0;'> <input type='text' id='input_tags' value='bird' /> <input type='button' id='input_submit' value='Show Data' /> </div>
Next, we'll need to create a function that will get called when the
input_submit
button is clicked. This function does three things. First, it will set thetags
parameter of the vector layer to be equal to whatever value is in theinput_tags
input box. Secondly, it will call the vector layer'srefresh()
method which updates the vector...