I suspect the solution is within libchamplain, but I'm asking here too, in case someone knows a way out.
In a small Python-Gtk3 program, I'm using libchamplain to select a location, and indicate a dimension.
To do so, I offer the user a circle, which they can control with two markers, centre and through.
When you drag the centre, the 'through-point' stays where it was, and the circle adapts accordingly. When you drag the 'through-point', you're controlling the radius of the circle. When you drag the circle, the two markers move around with it.
The problem is in this third option, because as it seems, libchamplain insists in pulling the object to the front in z order, so I cannot reach the centre point any more.
I opened an issue there, providing the source code of my python program. My solution, very dirty, is to remove the markers and create them again, every time the circle is dragged around. The new markers result in front of the circle, which is what I want, but it is not the way I want it.
I wonder if anybody has a neater solution, within the current version of libchamplain.
Apparently, libchamplain 0.12 does not honour the z-position
property: the z-order of markers in a layer is determined by the order in which they appear in the layer children list. This is initially the same order in which the markers were added to the layer.
The real confusion (from my point of view) starts when you click on an object, because at that moment libchamplain moves that object to the end of the children of its container, that is, on the top of the z-ordering.
Jiří Techet, library curator, suggests building my own marker as a best solution, and if I insist in misusing the API this way, to do it so:
self.layer.set_child_below_sibling(self.marker_circle)