sync cxx implementation of coalesceZooms