Skip to content

Commit

Permalink
Add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorix committed Dec 17, 2011
1 parent 8e43ee7 commit b0fe12f
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions lib/FeaturePopups.js
Expand Up @@ -159,8 +159,8 @@ OpenLayers.Control.FeaturePopups = OpenLayers.Class(OpenLayers.Control, {

/**
* Constructor: OpenLayers.Control.FeaturePopups
* TODO The control generates three types of popup: "hover", "select" and
* "list".
* The control generates three types of popup: "hover", "select" and
* "list", see <addLayer>.
* Each popup has a displayClass according to their type:
* "[displayClass]_hover" ,"[displayClass]_select" and
* "[displayClass]_list" respectively.
Expand Down Expand Up @@ -406,16 +406,28 @@ OpenLayers.Control.FeaturePopups = OpenLayers.Class(OpenLayers.Control, {

/**
* APIMethod: addLayer
* TODO: documenth xxxxxPopupTemplate! ???????????????????????????????????????????????????????????????????????????????????
* Add the layer to control and assigns it the templates, see options.
* Layers are automatically assigned if they have the properties for any of
* the three types of templates: hoverPopupTemplate, selectPopupTemplate
* and itemPopupTemplate.
* Not added layers to the control that do not have assigned any template,
* either as promiedades or as options in this method.
*
* Templates containing patterns as ${i18n("key")} are internationalized
* using <OpenLayers.i18n> function.
* In a item template patterns as ${showPopup()} becomes a combination of the
* layer-id + feature-id that is used to show individual popups from a
* list popup.
*
* Parameters:
* layer - {<OpenLayers.Layer.Vector>}
* options - {Object} Optional
*
* Options:
* hoverTemplate - {String || Function} template used on hover a feature
* selectTemplate - {String || Function} template used on select a feature
* itemTemplate - {String || Function} template used to show a feature as an item in a list, see also
* hoverTemplate - {String || Function} template used on hover a feature.
* selectTemplate - {String || Function} template used on select a feature.
* itemTemplate - {String || Function} template used to show a feature as
* a item in a list.
*/
addLayer: function (layer, options) {
options = OpenLayers.Util.extend({
Expand Down Expand Up @@ -939,13 +951,9 @@ OpenLayers.Control.FeaturePopups = OpenLayers.Class(OpenLayers.Control, {
/**
* Function: prepareTemplate
* When the template is a string returns a prepared template,
* otherwise returns it as is.
* Templates containing patterns as ${i18n("key")} are
* internationalized by this function using <OpenLayers.i18n> function.
* itemTemplate (see <addLayer>) containing patterns as ${showPopup()} are
* TODO: document! ???????????????????????????????????????????????????????????????????????????????????
* This function is used at creating a instance of the control and using
* <addLayer> method.
* otherwise returns it as is, see more in <addLayer>.
* This function is used at creating a instance of the control and when
* <addLayer> method is called.
*
* Parameters:
* template - {String || Function}
Expand Down

0 comments on commit b0fe12f

Please sign in to comment.