O'Reilly logo

OpenLayers 2.10 by Erik Hazzard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time For Action – adding dynamic tags to your map

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.

  1. 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>
  2. 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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required