-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from occamlabs/gfi-forceproperty
GetFeatureInfo forceproperty feature
- Loading branch information
Showing
10 changed files
with
238 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...-core-featureinfo/src/test/resources/org/deegree/featureinfo/templating/forceproperty.gfi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?template start> | ||
<html> | ||
<head> | ||
<title>deegree Feature Info</title> | ||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'></meta> | ||
</head> | ||
<body onload="loaded()"> | ||
<script type="text/javascript"> | ||
var headerStyle = 'font-family: Verdana, "Times New Roman", Times, serif; font-size: 110%; font-weight: normal; font-style: italic; background: #c1cde5; text-align: left;' | ||
var oddStyle = 'background-color: #ffffff;' | ||
var evenStyle = 'background-color: #D9E8FB;' | ||
var first | ||
|
||
function loaded() { | ||
var sw = document.getElementById('theswitch') | ||
var opt | ||
|
||
<?feature *:options> | ||
|
||
first() | ||
sw.value = sw.options[0].value // why're they counting from 0 here, and not from 1? | ||
} | ||
|
||
function addText(node, text){ | ||
if(!node.ownerDocument) node.ownerDocument = document | ||
node.appendChild(node.ownerDocument.createTextNode(text)) | ||
} | ||
|
||
function newnode(node, name, text){ | ||
if(!node.ownerDocument) node.ownerDocument = document | ||
var n = node.appendChild(node.ownerDocument.createElement(name)) | ||
if(text) addText(n, text) | ||
return n | ||
} | ||
|
||
var tags = ["p", "a", "td", "tr", "th", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "li", "table", "tbody", "b", "br", "i"] | ||
// beware of the scope... | ||
for(var tag in tags) { | ||
this[tags[tag]] = function(x){ | ||
return function (node, text){ | ||
return newnode(node, x, text) | ||
} | ||
}(tags[tag]) | ||
} | ||
|
||
function dotheswitch() { | ||
this[document.getElementById('theswitch').value + "_switchfunction"]() | ||
} | ||
<?feature *:switchfunction> | ||
</script> | ||
<p> | ||
Please select a feature type: | ||
</p> | ||
<form> | ||
<select id="theswitch" onchange="dotheswitch()"> | ||
</select> | ||
</form> | ||
<div id="table"></div> | ||
</body> | ||
</html> | ||
|
||
<?template options> | ||
opt = document.getElementById('<?name>') | ||
if(!opt){ | ||
opt = newnode(sw, 'option', '<?name:map ftname>') | ||
opt.setAttribute('id', '<?name>') | ||
opt.setAttribute('value', '<?name>') | ||
} | ||
|
||
<?template switchfunction> | ||
if(! this.<?name>_switchfunction){ | ||
this.<?name>_switchfunction = function(){ | ||
var div = document.getElementById('table') | ||
while(div.firstChild) div.removeChild(div.firstChild) | ||
var table = this.tbody(this.table(div)) | ||
var row = tr(table) | ||
th(row, "Field").style.cssText = headerStyle | ||
th(row, "Value").style.cssText = headerStyle | ||
for(var i in <?name>){ | ||
row = tr(table) | ||
td(row, 'GML ID').style.cssText = headerStyle | ||
td(row, '<?gmlid>').style.cssText = headerStyle | ||
<?name>[i](table) | ||
} | ||
} | ||
|
||
<?name> = [] | ||
} | ||
|
||
<?name>[<?name>.length] = function (table) { | ||
var odd = true | ||
var row | ||
<?property *:properties> | ||
<?forceproperty prop1,prop2:properties> | ||
} | ||
|
||
if(!first) first = <?name>_switchfunction | ||
|
||
<?template properties> | ||
row = tr(table) | ||
td(row, '<?name:map props>').style.cssText = odd ? oddStyle : evenStyle | ||
td(row, '<?value>').style.cssText = odd ? oddStyle : evenStyle | ||
odd = !odd | ||
|
||
<?map props> | ||
NAME=Name | ||
POP_2000=Population | ||
STATE=State | ||
|
||
<?map ftname> | ||
SGID93_LOCATION_UDOTMap_CityLocations=Cities in Utah County |
17 changes: 17 additions & 0 deletions
17
...e-featureinfo/src/test/resources/org/deegree/featureinfo/templating/forcepropertyeval.gfi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?template start> | ||
<html> | ||
<head> | ||
<title>force property test</title> | ||
</head> | ||
<body> | ||
<ol> | ||
<?feature *:featuretmpl> | ||
</ol> | ||
</body> | ||
</html> | ||
|
||
<?template featuretmpl> | ||
<li><?forceproperty test:propertytmpl></li> | ||
|
||
<?template propertytmpl> | ||
<?name> |
Oops, something went wrong.