Step 3: Install the Software
- On visiting the OpenLayers web site, I see that the latest stable release is 2.6. (By the time you visit it might have changed so fetch the latest version).
- I'm using a windows box so I fetch the zip file.
- I unzip it on to my hard drive (C:\OpenLayers-2.6) and read the readme.txt file.
- From preusing the GeoServer site I know that I can put static files in the www folder of my data directory, so I copy OpenLayers.js and the entire theme/ and img/ directories into it.
- I then copied the wms.html file from the examples directory of openlayers to the www directory, I need to edit it so it points to my geoserver too. I used notepad++ (but any text editor will do). Find the line which says "http://vmap0.tiles.osgeo.org/wms/vmap0 " and change that to say "http://localhost:8080/geoserver/wms" and change layers: 'basic' to layers: 'topp:states' and finally change ../lib/openlayers.js to openlayers.js. Then opening http://localhost:8080/geoserver/www/wms.html (assuming that you remembered to start tomcat) will show you a page like the one below. You may need to hit the "globe" button to zoom out (I didn't reset the bounding box).
With the required software now installed, we move on to Step 4 - the most complex step in the process - constructing the client.