Skip to content

Commit

Permalink
issue planetfederal#230 - fix closure compiler error for abstract key…
Browse files Browse the repository at this point in the history
…word used in structs
  • Loading branch information
justb4 committed Apr 10, 2014
1 parent 9f9587a commit ac6debd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/script/plugins/TMSSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]);
Expand All @@ -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) {
Expand All @@ -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
}));
}
Expand All @@ -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
}));
}
Expand Down

0 comments on commit ac6debd

Please sign in to comment.