Merge branch 'master' into bigbackbuffer

This commit is contained in:
Éric Lemoine
2011-10-28 21:26:59 +02:00
47 changed files with 240 additions and 247 deletions

View File

@@ -36,7 +36,7 @@
}
function test_layers(t) {
t.plan(25);
t.plan(37);
var xml = document.getElementById("ogcsample").firstChild.nodeValue;
var doc = new OpenLayers.Format.XML().read(xml);
@@ -61,9 +61,12 @@
t.eq(layer.styles[0].identifier, "DarkBlue", "style 0 identifier is correct");
t.eq(layer.styles[0].isDefault, true, "style 0 isDefault is correct");
t.eq(layer.styles[0].title, "Dark Blue", "style 0 title is correct");
t.eq(layer.styles[0].legend.href, "http://www.miramon.uab.es/wmts/Coastlines/coastlines_darkBlue.png", "style 0 legend href is correct");
t.eq(layer.styles[0].legend.format, "image/png", "style 0 legend format is correct");
t.eq(layer.styles[1].identifier, "thickAndRed", "style 1 identifier is correct");
t.ok(!layer.styles[1].isDefault, "style 1 isDefault is correct");
t.eq(layer.styles[1].title, "Thick And Red", "style 1 title is correct");
t.eq(layer.styles[1].legend, undefined, "style 1 legend is not set");
//t.eq(layer.styles[1].abstract, "Specify this style if you want your maps to have thick red coastlines. ", "style 1 abstract is correct");
t.eq(layer.tileMatrixSetLinks.length, 1, "correct count of tileMatrixSetLinks");
@@ -83,6 +86,17 @@
t.eq(layer.resourceUrl.FeatureInfo.format, "application/gml+xml; version=3.1", "resourceUrl.FeatureInfo.format is correct");
t.eq(layer.resourceUrl.FeatureInfo.template, "http://www.example.com/wmts/coastlines/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml",
"resourceUrl.FeatureInfo.template is correct");
var dimensions = layer.dimensions;
t.eq(dimensions.length, 1, "correct count of dimensions");
t.eq(dimensions[0].title, "Time", "first dimension title is correct");
t.eq(dimensions[0].abstract, "Monthly datasets", "first dimension abstract is correct");
t.eq(dimensions[0].identifier, "TIME", "first dimension identifier is correct");
t.eq(dimensions[0]['default'], "default", "first dimension default is correct");
t.eq(dimensions[0].values.length, 3, "first dimension has correct count of values");
t.eq(dimensions[0].values[0], "2007-05", "first value is correct");
t.eq(dimensions[0].values[1], "2007-06", "second value is correct");
t.eq(dimensions[0].values[2], "2007-07", "third value is correct");
}
function test_tileMatrixSets(t) {
@@ -271,6 +285,7 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml
<Value>2007-05</Value>
<Value>2007-06</Value>
<Value>2007-07</Value>
<Default>default</Default>
</Dimension>
<TileMatrixSetLink>
<TileMatrixSet>BigWorld</TileMatrixSet>

View File

@@ -458,6 +458,65 @@
t.xml_eq(result, expected, "WPS Execute written out correctly");
}
function test_write_WPSExecuteFID(t) {
t.plan(1);
var result,
expected,
format = ({geometryName: 'the_geom'});
expected = '<?xml version="1.0" encoding="UTF-8"?>' +
'<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" version="1.0.0" service="WPS" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">gs:Bounds</ows:Identifier>' +
' <wps:DataInputs>' +
' <wps:Input>' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Identifier>' +
' <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" method="POST">' +
' <wps:Body>' +
' <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0">' +
' <wfs:Query typeName="foo:bar">' +
' <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
' <ogc:FeatureId fid="123"/>' +
' </ogc:Filter>' +
' </wfs:Query>' +
' </wfs:GetFeature>' +
' </wps:Body>' +
' </wps:Reference>' +
' </wps:Input>' +
' </wps:DataInputs>' +
' <wps:ResponseForm>' +
' <wps:RawDataOutput>' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">bounds</ows:Identifier>' +
' </wps:RawDataOutput>' +
' </wps:ResponseForm>' +
'</wps:Execute>';
result = new OpenLayers.Format.WPSExecute().write({
identifier: 'gs:Bounds',
dataInputs: [{
identifier: 'features',
reference: {
mimeType: 'text/xml',
href: 'http://geoserver/wfs',
method: 'POST',
body: {
wfs: {
featureType: 'foo:bar',
version: '1.0.0',
filter: new OpenLayers.Filter.FeatureId({fids: [123]})
}
}
}
}],
responseForm: {
rawDataOutput: {
identifier: 'bounds'
}
}
});
t.xml_eq(result, expected, 'WPS Execute written out correctly with a FID filter');
}
</script>
</head>
<body>

View File

@@ -272,7 +272,7 @@
style: "blue_marble",
matrixSet: "arcgis_online",
tileSize: new OpenLayers.Size(512, 512),
requestEncoding: "REST",
requestEncoding: "REST"
});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0,0), 5);