Introduction to OpenLayers

Adgenda

The three hour workshop will be divided into 5 modules and we'll start with an introduction (and will leave some time for breaks).

  • Introduction (15 min)
  • Module 1: OpenLayers Basics (30 min)
  • Break (5 minutes)
  • Module 2: Layers (30 min)
  • Module 3: Controls (30 min)
  • Break (10 minutes)
  • Module 4: Vector Data (30 min)
  • Module 5: Integration (30 min)

The introduction will consist of presenters introducing ourselves and some slides on what OpenLayers is all about, the history of the project, and background on some topics that will be covered in the modules (JavaScript, WMS, WFS, etc.).

Material

All workshop material is available in subversion. In addition, the workshop assumes that Apache and GeoServer are running locally and configured for the workshop.

Getting set up for the workshop.

  1. Get the workshop material.

svn co http://svn.opengeo.org/workshops/openlayers/intro ol_workshop

  1. Export the above to your Apache document root, or set up an alias so that http://localhost/ol_workshop/1-basics.html loads.
  2. Install GeoServer (or if you don't want to, skip to Option 2 in step 4).

If you are on a Windows machine, download and run http://files.opengeo.org/geoserver-1.6.5-foss4gworkshop.exe. GeoServer can then be started from your start menu.

  1. Configure proxy so that GeoServer is be accessible from http://localhost/geoserver/.

(Option 1 - GeoServer running locally on port 8910) If you used the windows installer, GeoServer is listening on port 8910 and you should configure Apache to proxy in a virtual host block with something like the following:

<VirtualHost *>

# ...
ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /geoserver http://localhost:8910/geoserver
ProxyPassReverse /geoserver http:/localhost:8910/geoserver
# ...

</VirtualHost>

(Option 2 - No local GeoServer installed) You can also configure Apache to proxy a publicly accessible GeoServer with the workshop data. This is slightly different than the proxy directives above.

<VirtualHost *>

# ...
    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass /geoserver/ http://publicus.opengeo.org/foss4g_workshop/
    ProxyPassReverse /geoserver/ http://publicus.opengeo.org/foss4g_workshop/
# ...

</VirtualHost>