[Commits] r1328 - in sandbox/camptocamp/geobretagne: lib/GeoExt/data tests/lib/GeoExt/data
commits at geoext.org
commits at geoext.org
Wed Aug 19 10:57:34 CEST 2009
Author: bbinet
Date: 2009-08-19 10:57:34 +0200 (Wed, 19 Aug 2009)
New Revision: 1328
Modified:
sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/LayerReader.html
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html
Log:
apply patch patch_150-r1327-A1.diff from geoext ticket 150: LayerRecord should have consistent id when generated by LayerReader or WMSCapabilitiesReader
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js 2009-08-12 13:45:33 UTC (rev 1327)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js 2009-08-19 08:57:34 UTC (rev 1328)
@@ -152,27 +152,28 @@
for(var i=0, len=capability.layers.length; i<len; i++){
layer = capability.layers[i];
if(layer.name) {
+ var l = new OpenLayers.Layer.WMS(
+ layer.title || layer.name,
+ url, {
+ layers: layer.name,
+ exceptions: this.serviceExceptionFormat(
+ capability.exception.formats
+ ),
+ format: this.imageFormat(layer),
+ version: data.version
+ }, {
+ minScale: layer.minScale != undefined ?
+ layer.minScale : undefined,
+ maxScale: layer.maxScale != undefined ?
+ layer.maxScale : undefined,
+ attribution: layer.attribution ?
+ this.attributionMarkup(layer.attribution) :
+ undefined
+ }
+ );
records.push(new this.recordType(Ext.apply(layer, {
- layer: new OpenLayers.Layer.WMS(
- layer.title || layer.name,
- url, {
- layers: layer.name,
- exceptions: this.serviceExceptionFormat(
- capability.exception.formats
- ),
- format: this.imageFormat(layer),
- version: data.version
- }, {
- minScale: layer.minScale != undefined ?
- layer.minScale : undefined,
- maxScale: layer.maxScale != undefined ?
- layer.maxScale : undefined,
- attribution: layer.attribution ?
- this.attributionMarkup(layer.attribution) :
- undefined
- }
- )
- })));
+ layer: l
+ }), l.id));
}
}
Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/LayerReader.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/LayerReader.html 2009-08-12 13:45:33 UTC (rev 1327)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/LayerReader.html 2009-08-19 08:57:34 UTC (rev 1328)
@@ -33,7 +33,7 @@
}
function test_readRecords(t) {
- t.plan(5);
+ t.plan(6);
var reader, layers, data;
@@ -50,6 +50,8 @@
"readRecords returns expected number of records");
t.ok(data.records[0] instanceof GeoExt.data.LayerRecord,
"readRecords returns records of expected type");
+ t.ok(data.records[0].id == layers[0].id,
+ "readRecords returns records with expected \"id\"");
t.ok(data.records[0].get("layer") == layers[0],
"readRecords returns records with expected \"layer\" field");
t.eq(data.records[0].get("title"), layers[0].name,
Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html 2009-08-12 13:45:33 UTC (rev 1327)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/WMSCapabilitiesReader.html 2009-08-19 08:57:34 UTC (rev 1328)
@@ -33,7 +33,7 @@
'field values set from configuration are correct');
}
function test_read(t) {
- t.plan(32);
+ t.plan(33);
var reader = new GeoExt.data.WMSCapabilitiesReader();
@@ -44,6 +44,9 @@
var record = records.records[2];
+ //1 test -- testing value of record id
+ t.ok(record.id == record.get("layer").id, "[2] correct record id");
+
//8 tests -- testing the fields of a record
t.eq(record.get("name"), "tiger:tiger_roads", "[2] correct layer name");
t.eq(record.get("title"), "Manhattan (NY) roads", "[2] correct layer title");
More information about the Commits
mailing list