Use layer id instead of name for hash
- to make it work across languages and on translation changes - with legacy support for old names
This commit is contained in:
parent
3d60b05422
commit
d60b1ad15f
4 changed files with 105 additions and 22 deletions
|
|
@ -293,6 +293,28 @@ BR.LayersTab = BR.ControlLayers.extend({
|
|||
return layer;
|
||||
},
|
||||
|
||||
getLayerById: function (id) {
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
var obj = this._layers[i];
|
||||
if (obj.layer.id === id) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
getLayerByLegacyName: function (legacyName) {
|
||||
var obj = null;
|
||||
var id = this.layersConfig.legacyNameToIdMap[legacyName];
|
||||
|
||||
if (id) {
|
||||
obj = this.getLayerById(id);
|
||||
}
|
||||
|
||||
return obj;
|
||||
},
|
||||
|
||||
saveRemoveActiveLayers: function () {
|
||||
this.saveLayers = this.removeActiveLayers();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue