Permalink
Browse files

Only use the preconfigured record when the source is lazy.

  • Loading branch information...
1 parent d9fa67e commit 0576e6ebc88e6909de451f1f6170f5e9d1239dcb @ahocevar ahocevar committed Aug 16, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/script/plugins/AddLayers.js
@@ -588,7 +588,12 @@ gxp.plugins.AddLayers = Ext.extend(gxp.plugins.Tool, {
var layerStore = this.target.mapPanel.layers,
extent, record, layer;
for (var i=0, ii=records.length; i<ii; ++i) {
- record = records[i];
+ // If the source is lazy, then createLayerRecord will not return
+ // a record, and we take the preconfigured record.
+ record = source.createLayerRecord({
+ name: records[i].get("name"),
+ source: source.id
+ }) || records[i];
if (record) {
layer = record.getLayer();
if (layer.maxExtent) {

0 comments on commit 0576e6e

Please sign in to comment.