Fix query on external WMS

fix #742