Add eventListeners usage example in APIdoc

This commit is contained in:
fredj
2012-02-01 15:32:14 +01:00
parent fc0152ea1e
commit 263b429c49

View File

@@ -44,6 +44,21 @@ OpenLayers.Tile = OpenLayers.Class({
* object will be registered with <OpenLayers.Events.on>. Object
* structure must be a listeners object as shown in the example for
* the events.on method.
*
* This options can be set in the ``tileOptions`` option from
* <OpenLayers.Layer.Grid>. For example, to be notified of the
* ``loadend`` event of each tiles:
* (code)
* new OpenLayers.Layer.OSM('osm', 'http://tile.openstreetmap.org/${z}/${x}/${y}.png', {
* tileOptions: {
* eventListeners: {
* 'loadend': function(evt) {
* // do something on loadend
* }
* }
* }
* });
* (end)
*/
eventListeners: null,