Support structured queryLayers on background layers

Fix #372