1
|
/*
|
2
|
Author: Andreas Hocevar andreas.hocevarATgmail.com
|
3
|
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
4
|
|
5
|
$Id: GmlRendererBase.js 3887 2008-02-27 18:18:53Z ahocevar $
|
6
|
*/
|
7
|
|
8
|
// Ensure this object's dependancies are loaded.
|
9
|
mapbuilder.loadScript(baseDir+"/widget/WidgetBase.js");
|
10
|
|
11
|
/**
|
12
|
* Render GML into HTML.
|
13
|
* this.targetModel references the context model for the map
|
14
|
* where the content of this widget should be rendered to.
|
15
|
* If the model doc is not wfs compliant, a stylesheet
|
16
|
* property has to be set for this widget. The xsl file
|
17
|
* referenced in this property transforms the model doc to
|
18
|
* a wfs FeatureCollection.
|
19
|
* @constructor
|
20
|
* @base WidgetBase
|
21
|
* @param widgetNode The widget's XML object node from the configuration document.
|
22
|
* @param model The model object that this widget belongs to.
|
23
|
*/
|
24
|
function GmlRendererBase(widgetNode, model) {
|
25
|
WidgetBase.apply(this,new Array(widgetNode, model));
|
26
|
|
27
|
// set the feature srs.
|
28
|
/** SRS of the features that this widget will render */
|
29
|
this.featureSRS = this.getProperty('mb:featureSRS');
|
30
|
|
31
|
// set the hover cursor.
|
32
|
/** css cursor when hovering over features */
|
33
|
this.hoverCursorNode = this.getProperty('mb:hoverCursor', 'pointer');
|
34
|
|
35
|
/** model holding the sld for feature styles of this widget */
|
36
|
this.sldModelNode = widgetNode.selectSingleNode('mb:sldModel');
|
37
|
|
38
|
// set the default style.
|
39
|
/** sld node within the sld model that is used for default styling */
|
40
|
this.defaultStyleName = this.getProperty('mb:defaultStyleName', 'default');
|
41
|
|
42
|
// set the select style
|
43
|
/** sld node within the sld model that is used when a feature is hovered */
|
44
|
this.selectStyleName = this.getProperty('mb:selectStyleName', 'selected');
|
45
|
|
46
|
/**
|
47
|
* config object holding all configurations that might be different
|
48
|
* among source models (if a MergeModel with multiple GmlRendererConfig
|
49
|
* widgets is used).
|
50
|
*/
|
51
|
this.config = new Object({
|
52
|
model: model,
|
53
|
hoverCursor: this.hoverCursor,
|
54
|
sldModelNode: this.sldModelNode,
|
55
|
defaultStyleName: this.defaultStyleName,
|
56
|
selectStyleName: this.selectStyleName,
|
57
|
featureSRS: this.featureSRS
|
58
|
});
|
59
|
}
|