Skip to content

Commit 0b62a8c

Browse files
committed
reducers/layers: introduce srcid and only compress layers if they have the same srcid
1 parent e6cb25a commit 0b62a8c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

reducers/layers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export default function layers(state = defaultState, action) {
132132
const newLayer = {
133133
...action.layer,
134134
id: layerId,
135+
srcid: uuidv4(),
135136
name: action.layer.name || layerId,
136137
role: action.layer.role || LayerRole.USERLAYER,
137138
queryable: action.layer.queryable || false,

utils/LayerUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ const LayerUtils = {
496496
// Attempt to merge with previous if possible
497497
let target = newlayers.length > 0 ? newlayers[newlayers.length - 1] : null;
498498
let source = layer;
499-
if (target && target.sublayers && target.url === layer.url) {
499+
if (target && target.sublayers && target.srcid === layer.srcid) {
500500
let innertarget = target.sublayers[target.sublayers.length - 1];
501501
let innersource = source.sublayers[0]; // Exploded entries have only one entry per sublayer level
502502
while (innertarget && innertarget.sublayers && innertarget.name === innersource.name) {

0 commit comments

Comments
 (0)