1
|
/*
|
2
|
Author: Mike Adair mike.adairATccrs.nrcan.gc.ca
|
3
|
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
4
|
|
5
|
$Id$
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Model which represents the results of a GetMap request. In this case the
|
10
|
* mime type of the model document is probably be an image type.
|
11
|
* tbd: this still needed?
|
12
|
* @constructor
|
13
|
* @base ModelBase
|
14
|
* @param modelNode The model's XML object node from the configuration document.
|
15
|
* @param parent The model object that this model belongs to.
|
16
|
*/
|
17
|
function GetMap(modelNode, parent) {
|
18
|
// Inherit the ModelBase functions and parameters
|
19
|
ModelBase.apply(this, new Array(modelNode, parent));
|
20
|
this.namespace = "xmlns:gml='http://www.opengis.net/gml' xmlns:wfs='http://www.opengis.net/wfs'";
|
21
|
|
22
|
this.prePaint = function(objRef) {
|
23
|
objRef.stylesheet.setParameter("width", objRef.containerModel.getWindowWidth() );
|
24
|
objRef.stylesheet.setParameter("height", objRef.containerModel.getWindowHeight() );
|
25
|
bBox=objRef.containerModel.getBoundingBox();
|
26
|
var bboxStr = bBox[0]+","+bBox[1]+","+bBox[2]+","+bBox[3];
|
27
|
objRef.stylesheet.setParameter("bbox", bboxStr );
|
28
|
objRef.stylesheet.setParameter("srs", objRef.containerModel.getSRS() );
|
29
|
objRef.stylesheet.setParameter("version", objRef.model.getVersion(objRef.featureNode) );
|
30
|
objRef.stylesheet.setParameter("baseUrl", objRef.model.getServerUrl("GetMap") );
|
31
|
objRef.stylesheet.setParameter("mbId", objRef.featureNode.getAttribute("id") );
|
32
|
objRef.resultDoc = objRef.featureNode;
|
33
|
}
|
34
|
|
35
|
/**
|
36
|
*
|
37
|
* @param objRef Pointer to this object.
|
38
|
*/
|
39
|
this.loadLayer = function(objRef, feature) {
|
40
|
objRef.featureNode = feature;
|
41
|
objRef.paint(objRef);
|
42
|
}
|
43
|
this.addListener("GetMap", this.loadLayer, this);
|
44
|
|
45
|
}
|
46
|
|