OpenLayers OpenLayers

UserRecipes

Lots of examples of using OpenLayers in different ways

WMS

Examples files:

The example files can all be seen at: http://openlayers.org/dev/examples/

These are examples of OpenLayers functionality. Through these files, you can probably figure out almost all of what OpenLayers can do at the surface level: there are over 90 examples here, and they demonstrate many of the layers, controls, etc. It is usually best to start with an example, and work your way forward from there. If you have never used OpenLayers before: Start Here!

TODO: Also some description of each of the examples... although the HTML files themselves should really have some description added.

Basic

  • xhtml.html - shows openlayers runnig in a XHTML 1.0 Strict Doctype.
  • baseLayers.html - shows the use base layers from multiple commercial map image providers.
  • doubleSetCenter.html - demonstrate the behavior of two calls to set the center after instatiating the layer object.
  • fullScreen.html - demonstrate a map that fill the entire browser window.
  • layer-opacity.html - demonstrate a change in the opacity for an overlay layer.
  • lite.html - a very simple layout with minimal controls. This example uses a single WMS base layer.
  • image-layer.html - demonstrate a single non-tiled image as a selectable base layer.
  • zoomLevels.html - shows the use of the resolutions layer option on a number of layer types.
  • getfeatureinfo.html - demonstrates sending a GetFeatureInfo query to an OWS.

Control

Event

Editing

  • drag-feature.html - demonstrates point, line and polygon creation and editing.
  • draw-feature.html - demonstrates on-screen digitizing tools for point, line, and polygon creation.
  • modify-feature.html - a demonstration of the ModifyFeature control for editing vector features.
  • editingtoolbar.html - demonstrate polygon, polyline and point creation and editing tools.
  • rotate-features.html - details on how to create and rotate vector features programmatically
  • regular-polygons.html - shows how to use the RegularPolygon handler to draw features with different numbers of sides.
  • resize-features.html - use the geometry resize methods to change feature sizes programatically.

Raster provider

WMS

  • wms.html - shows the basic use of openlayers using a WMS layer.
  • wms-untiled.html - shows an example of the Untiled wms layer, which requests a single image for the entire map view.
  • wmst.html - shows the use of the layer WMS-T (time) layer.

MapServer

Commercial provider

Tiling

  • tilecache.html - demonstrates a TileCache layer that loads tiles from from a web accessible disk-based cache only.
  • multiserver.html - load your tiles faster by pointing to the same server, but with different urls.
  • notile.html - create an untiled WMS layer using the singleTile: true, option or the deprecated WMS.Untiled layer.
  • buffer.html - shows the use of the buffer layer option for any layer that inherits from OpenLayers.Layer.Grid.
  • gutter.html - demonstrates map tiling artifacts, and OpenLayer's facility for correcting this distortion.
  • tms.html - demonstrate the initialization and modification of a Tiled Map Service layer.

Vector provider

WFS

  • wfs-scribble.html - shows how you can draw features and save to GeoServer.
  • wfs-states.html - shows the use of the WFS United States (GeoServer).
  • wfs-t.html - shows the use of the WFS layer type.
  • openmnnd.html - shows rendering a WFS service using OpenLayer vectors in the browser.
  • wfs.html - take in XML data from a WFS class and display it any way you like.

GML

files:

KML

WKT

  • wkt.html - shows the use of WKT (Well known text) to draw features in openlayers.

GeoRSS

files:

Marker

files:

Style

Parser

Other

  • debug.html - demonstrate console calls to a Firebug console. Requires Firefox. Mostly for developers.
  • wrapDateLine.html - shows how to work around dateline issues, by wrapping the dateline on a number of layer types.
  • projected-map.html - use different (not default) projections with your map.