| 402 | | record = this.capabilities.getAt(id).copy(); |
|---|
| 403 | | layer = record.get("layer"); |
|---|
| | 402 | /** |
|---|
| | 403 | * If the same layer is added twice, it will get replaced |
|---|
| | 404 | * unless we give each record a unique id. In addition, we |
|---|
| | 405 | * need to clone the layer so that the map doesn't assume |
|---|
| | 406 | * the layer has already been added. Finally, we can't |
|---|
| | 407 | * simply set the record layer to the cloned layer because |
|---|
| | 408 | * record.set compares String(value) to determine equality. |
|---|
| | 409 | * |
|---|
| | 410 | * TODO: suggest record.clone |
|---|
| | 411 | */ |
|---|
| | 412 | Ext.data.Record.AUTO_ID++; |
|---|
| | 413 | record = this.capabilities.getAt(id).copy(Ext.data.Record.AUTO_ID); |
|---|
| | 414 | layer = record.get("layer").clone(); |
|---|
| | 415 | record.set("layer", null); |
|---|
| | 416 | record.set("layer", layer); |
|---|