Can't we leave toggleLayer unchanged by doing the following:

```
scope.$watch('item.selectedOpen', function(newVal, oldVal) {
  if (newVal != oldVal) {
    toggleLayer(scope.item, scope.map);
  }
});
```

?

See https://github.com/geoadmin/mf-geoadmin3/commit/d1de351f00a75e0cc1d4b6a699dd3e0acbb5978b for an attempt.