Reply to topic

Switch between multiple layers in marblewidget

Registered Member
Hi guys

Suppose I have two tile servers providing different type of tiles and both are configured in the dgml theme file. Now want to implement a function that can switch between the two layers in marblewidget. Is there a way to do it? Now I have already managed to render one single layer using marblewidget. It seems i need to use the MarbleControlBox widget to do it. But I did not find much info on how to do it. How can I control which of those multiple layers should be shown?

User avatar Earthwings
KDE Developer
The easiest approach is probably to do it similar like the hillshading layer in the OpenStreetMap theme is implemented: Two texture layers are defined in the .dgml file, and there's a checkbox control defined in the .dgml file that controls whether the hillshading layer is used. If so, the hillshading texture is blended over the base texture. You can use plain Marble and its hillshading checkbox in the Legend Panel to see it in action. The blending type is also defined in the .dgml file and a couple different ones are available (including ones that do not blend one over the other which is probably what you want here). So you could setup your .dgml file to have two checkbox controls (or radio buttons, IIRC we support them as well) that toggle the visibility of the layer for each tile server you're using. Then trace the code to see what kind of property changes when the checkbox is clicked, and do the same in your code.

Reply to topic


Who is online

Registered users: Baidu [Spider], Bing [Bot], Dibo, Google [Bot], Sogou [Bot]