On Mon, Jun 14, 2010 at 4:08 PM, François Van Der Biest
<[email protected]> wrote:
> Hi all,
>
> Currently, we have in LayerRecord.js :
> GeoExt.data.LayerRecord = Ext.data.Record.create([
>    {name: "layer"},
>    {name: "title", type: "string", mapping: "name"}
> ]);
>
> The mapping can be annoying, for instance when restoring a WMC context :
> layerStore.add(wmcReader.readRecords(wmcFormat.read(wmcString, {})).records);
> In the above case, layerRecords end up with their title set to the
> layer names instead of their correct titles.
>
> A quick workaround is to set values["title"] to layerContext["title"]
> in WMSReader.js, L102
> Would you see other options ? (as I don't think that removing the
> above mapping would be a valid one)

Maybe the WMCReader should override this field, just like the
WMSCapabilitiesReader does. See the attached patch.




-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
diff --git lib/GeoExt/data/WMCReader.js lib/GeoExt/data/WMCReader.js
index 0c28d6b..b929925 100644
--- lib/GeoExt/data/WMCReader.js
+++ lib/GeoExt/data/WMCReader.js
@@ -38,6 +38,7 @@ GeoExt.data.WMCReader = function(meta, recordType) {
         recordType = GeoExt.data.LayerRecord.create(
             recordType || meta.fields || [
                 // give only non-OpenLayers fields as default recordType
+                {name: "title", type: "string"},
                 {name: "abstract", type: "string"},
                 {name: "metadataURL", type: "string"},
                 {name: "queryable", type: "boolean"},
_______________________________________________
Dev mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/dev

Reply via email to