From ac6debdfca35154f31ac0c2c2adbbca31bc17be1 Mon Sep 17 00:00:00 2001 From: Just van den Broecke Date: Thu, 10 Apr 2014 18:32:30 +0200 Subject: [PATCH] issue #230 - fix closure compiler error for abstract keyword used in structs --- src/script/plugins/TMSSource.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/script/plugins/TMSSource.js b/src/script/plugins/TMSSource.js index e1d89764..0115f642 100644 --- a/src/script/plugins/TMSSource.js +++ b/src/script/plugins/TMSSource.js @@ -20,12 +20,12 @@ gxp.data.TMSCapabilitiesReader = Ext.extend(Ext.data.DataReader, { if (!meta.format) { meta.format = new OpenLayers.Format.TMSCapabilities(); } + // JvdB: Added abstract, was returned but not in record def+data. if(typeof recordType !== "function") { recordType = GeoExt.data.LayerRecord.create( recordType || meta.fields || [ {name: "name", type: "string"}, {name: "title", type: "string"}, - // JvdB: Added abstract, was returned but not in record def+data. {name: "abstract", type: "string"}, {name: "tileMapUrl", type: "string"} ]); @@ -45,6 +45,9 @@ gxp.data.TMSCapabilitiesReader = Ext.extend(Ext.data.DataReader, { if (typeof data === "string" || data.nodeType) { data = this.meta.format.read(data); this.raw = data; + // JvdB: Closure compiler chokes over 'abstract' (reserved keyword) + var abstrct = data['abstract']; + // a single tileMap, someone supplied a url to a TileMap if (!data.tileMaps) { if (data.tileSets) { @@ -69,7 +72,7 @@ gxp.data.TMSCapabilitiesReader = Ext.extend(Ext.data.DataReader, { ), title: data.title, name: data.title, - abstract: data.abstract, + "abstract": abstrct, tileMapUrl: this.meta.baseUrl })); } @@ -90,7 +93,7 @@ gxp.data.TMSCapabilitiesReader = Ext.extend(Ext.data.DataReader, { ), title: tileMap.title, name: tileMap.title, - abstract: data.abstract, + "abstract": abstrct, tileMapUrl: url })); }