"""WMS CartoWeb IGN — built-in companion plugin.
Loads IGN CartoWeb topographic WMS layers into the active WolfMapViewer:
- Background: crossborder, crossborder_grey, overlay, topo, topo_grey.
- Foreground: same layers available as overlays.
"""
from wolfhece._builtin_plugins.wms_base import WmsLayerCompanion
from wolfhece.PyTranslate import _
[docs]
class WmsCartowebCompanion(WmsLayerCompanion):
"""Companion plugin that loads IGN CartoWeb WMS layers."""
[docs]
def _do_load_layers(self) -> None:
from wolfhece.wolf_texture import imagetexture
v = self.proxy._viewer
xmin = xmax = ymin = ymax = 0
ign_cartoweb = {
'CartoWeb': {
'Crossborder': 'crossborder',
'Crossborder Grey': 'crossborder_grey',
'Overlay': 'overlay',
'Topographic': 'topo',
'Topographic Grey': 'topo_grey',
},
}
for k, item in ign_cartoweb.items():
for m, subitem in item.items():
self._add_wms('wmsback',
imagetexture('Cartoweb IGN', m, k, subitem,
v, xmin, xmax, ymin, ymax, -99999, 1024,
IGN_Cartoweb=True),
'IGN ' + m)
for k, item in ign_cartoweb.items():
for m, subitem in item.items():
self._add_wms('wmsfore',
imagetexture('Cartoweb', m, k, subitem,
v, xmin, xmax, ymin, ymax, -99999, 1024,
IGN_Cartoweb=True),
'IGN_f ' + m)
self.proxy.set_status(_('CartoWeb WMS layers loaded.'))