Allow for SLD input.
This commit is contained in:
+21
-2
@@ -80,8 +80,9 @@ function buildForm() {
|
|||||||
document.getElementById("input").innerHTML = "<h3>Input:</h3>";
|
document.getElementById("input").innerHTML = "<h3>Input:</h3>";
|
||||||
document.getElementById("output").innerHTML = "";
|
document.getElementById("output").innerHTML = "";
|
||||||
|
|
||||||
var inputs = process.dataInputs, supported = true;
|
var inputs = process.dataInputs, supported = true,
|
||||||
var input;
|
sld = "text/xml; subtype=sld/1.0.0",
|
||||||
|
input;
|
||||||
for (var i=0,ii=inputs.length; i<ii; ++i) {
|
for (var i=0,ii=inputs.length; i<ii; ++i) {
|
||||||
input = inputs[i];
|
input = inputs[i];
|
||||||
if (input.complexData) {
|
if (input.complexData) {
|
||||||
@@ -92,6 +93,8 @@ function buildForm() {
|
|||||||
addWFSCollectionInput(input);
|
addWFSCollectionInput(input);
|
||||||
} else if (formats["image/tiff"]) {
|
} else if (formats["image/tiff"]) {
|
||||||
addRasterInput(input);
|
addRasterInput(input);
|
||||||
|
} else if (formats[sld]) {
|
||||||
|
addXMLInput(input, sld);
|
||||||
} else {
|
} else {
|
||||||
supported = false;
|
supported = false;
|
||||||
}
|
}
|
||||||
@@ -155,6 +158,22 @@ function addWKTInput(input, previousSibling) {
|
|||||||
container.appendChild(field);
|
container.appendChild(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addXMLInput(input, type) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var field = document.createElement("input");
|
||||||
|
field.title = input["abstract"];
|
||||||
|
field.value = name + " (" + type + ")";
|
||||||
|
field.onblur = function() {
|
||||||
|
input.data = field.value ? {
|
||||||
|
complexData: {
|
||||||
|
mimeType: type,
|
||||||
|
value: this.value
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
};
|
||||||
|
document.getElementById("input").appendChild(field);
|
||||||
|
}
|
||||||
|
|
||||||
// helper function to dynamically create a WFS collection reference input
|
// helper function to dynamically create a WFS collection reference input
|
||||||
function addWFSCollectionInput(input) {
|
function addWFSCollectionInput(input) {
|
||||||
var name = input.identifier;
|
var name = input.identifier;
|
||||||
|
|||||||
Reference in New Issue
Block a user