 }
                }

                if (index < 0 || keepSelection) {
                    layer.setStyle({color: '#ff4620', dashArray: '4'});
                    selection.push({target: target, layer: layer});
                } else {
                    target.resetStyle(layer);
                    selection.splice(index, 1);
                }
            }

            function clearSelection() {
                while (selection.length > 0) {
                    let object = selection.pop();
           