Only add layer with key to swicher if key configured (#145)
This commit is contained in:
parent
08dacd8c3d
commit
bb097c6c5b
1 changed files with 7 additions and 1 deletions
|
|
@ -135,7 +135,13 @@ BR.LayersConfig = L.Class.extend({
|
|||
var layerData = BR.layerIndex[layerId];
|
||||
|
||||
if (layerData) {
|
||||
layers[layerData.properties.name] = this.createLayer(layerData);
|
||||
// when key required only add if configured
|
||||
var keyObj = this.getKeyName(layerData.properties.url);
|
||||
if (!keyObj || (keyObj && BR.keys[keyObj.name])) {
|
||||
layers[layerData.properties.name] = this.createLayer(
|
||||
layerData
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.error('Layer not found: ' + layerId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue