Please note that this demo uses the following deprecated widget(s) : map, mapfishlayertree.
You can have multiple QueryOnClick widgets, each one using its own "result" widget. They have unique icon by defining the "iconCls" option, which the value must be a valid CSS class name loaded manually.
Shows the use of the "ResultVectorLayer" result. It was configured with the 'singleMode' option set to 'true' to allow only one type of feature to be displayed at a time.
Shows the use of the 'multipleKey' option. Hold the "SHIFT" key while querying the map to keep previously queried features. Also, when you make queries using this 'multiple' mode, you'll notice that only one request is made instead of 3. That is because the ResultVectorLayer is in 'singleMode' and only the current resource gets requested.
Clicking on the same feature while in 'multiple' mode won't select it again because the resource option 'primaryField' was set. Instead, it will unselect it (because the widget has the 'toggle' option set to true).