Example code
The primary source of documentation for the library is our
In general, our examples are routinely checked for problems, and are included in every download of OpenLayers, which helps keep them up to date and in line with current code. We try to make sure that all new functionality is covered by at least one example.
Using the search box on the examples page will let you find examples about what you're looking for relatively easily, if any are available.
This page also lists other sources of documentation, so browsing it may help you find what you're looking for.
Documentation
OpenLayers has begun maintaining a set of prose documentation. Currently, it is minimal, but in the long term, most stable wiki documentation should be migrated into this website.
If you have a question you want to see answered, it may be available from our FAQ.
OpenLayers JavaScript API Documentation
Automatically generated API documentation is available:
- 2.12 (Last stable release) API Natural Docs on dev.openlayers.org.
- Trunk API Natural Docs on dev.openlayers.org.
See Natural Docs conventions if you are contributing code.
Note on API Stability:
There are two types of properties/methods in the OpenLayers code: One set is the set of API Methods and properties. There are also additional internal properties which are not exposed to the API. Javascript does not have private members, so there is no technical limitation to using these non-documented methods in Application code. However, while we make every effort not to change APIs between releases, methods and properties which are not explicitly declared as API Methods may change in minor releases.
The documentation above only includes the API Methods. Full developer/internal library documentation is also available below, but methods which are not available in the API documentation above can not be depended upon to stay the same between releases. If you use methods included in these docs, you may have to make modifications in your application code to run between minor releases of OpenLayers.
- 2.12 (Last stable release) Developer Library Natural Docs on dev.openlayers.org
- Trunk Developer Library Natural Docs on dev.openlayers.org
Before Getting Started -- The Technologies Behind OpenLayers
We at OpenLayers generally assume that everyone who comes to us is already a highly skilled web programmer. Such, however, is not always the case. Here we have assembled a few quick links to tutorials and the like on how to master the art of coding in JavaScript, debug in Firebug, understand JSON, etc.
- Introduction to JavaScript by the people at mootools.
- Four-part video series by Douglas Crockford on Programming in JavaScript
- Crockford's JavaScript page
- Introduction to JSON
- Debugging with Firebug
Other OpenLayers Documentation
- OpenLayers Example Files
- UserGuide - Start of a page giving some usage examples (very unfinished)
- The English translation of Emanuel Schütze's Thesis on Smart Map Browsing contains a technical analysis of OpenLayers.
- UserRecipes - List of examples
- UML - UML Class Diagrams of OpenLayers
- Setting up OpenLayers/TileCache with TurboGears
- OpenLayersCursors Beginner's Guide to building and using cursors in OpenLayers
- Proposition for Nice and structured documentation
- OpenLayers 2.7 Cheat Sheet, brought to you by Selectoid's Weblog
- The OpenLayers Cluster strategy class, how it works and how to customize it
- Tutorial by Peter Robins
International Documentation
French
- Some documentation on OpenLayers and Tilecache
- Other documentation on OpenLayers
- Workshop FOSS4G 2008 : Une introduction à OpenLayers (workshop wrote by Tim Schaub for the FOSS4G 2008 workshop on OpenLayers)
Russian / Русский
- User Guide - Руководство пользователя

