How to manage zIndex of entities and primitives which is clampToGround

I use both GroundPrimitive and Datasources(which is clampToGround set true). But I found GroundPrimitive cover the other entity. How to solve that issue? I traversal entities in datasource and set zIndex option of polygon/polyline to manage all the zIndex, but I found it is helpless for primitive.