Project

General

Profile

1
/*
2
Author:       Andreas Hocevar andreas.hocevarATgmail.com
3
License:      LGPL as per: http://www.gnu.org/copyleft/lesser.html
4

    
5
$Id: GmlRendererConfig.js 3879 2008-02-27 14:20:29Z gjvoosten $
6
*/
7

    
8
// Ensure this object's dependancies are loaded.
9
mapbuilder.loadScript(baseDir+"/widget/GmlRendererBase.js");
10

    
11
/**
12
 * Configuration for GmlRendererOL.
13
 * This widget is used in models that merge into a MergeModel to specify
14
 * a GmlRenderer configuration (sld, cursor style). The GmlRendererOL in
15
 * the MergeModel will check for configurations in source models and use
16
 * them.
17
 * @constructor
18
 * @base GmlRendererBase
19
 * @param widgetNode  The widget's XML object node from the configuration document.
20
 * @param model       The model object that this widget belongs to.
21
 */
22
function GmlRendererConfig(widgetNode, model) {
23
  GmlRendererBase.apply(this,new Array(widgetNode, model));
24
  
25
  var targetWidget = this.getProperty('mb:targetWidget');
26
  
27
  this.init = function(objRef) {
28
    if (targetWidget) {
29
      if (!model.config) {
30
        model.config = {};
31
      }
32
      model.config[targetWidget] = objRef.config;
33
    }
34
  }
35
  model.addListener('init', this.init, this);
36
}
(48-48/145)