Fix issue where associated WMS layer is remote

As discussed at https://github.com/camptocamp/c2cgeoportal/pull/582/files#r4092221.

Thanks @sbrunner.