GeoPrisma logo

QueryOnClick

Widget that send GetFeatureInfo requests when the map is clicked. Only visible layers are queried.

To display the query results, the widget must use one or more of theses widgets :

Note

This widget can’t be drawn with the drawWidget template. Instead, it must be added to one of the toolbar widgets :

  • Toolbar
  • GeoExtToolbar

Note

When added to the GeoExtToolbar, a dropDown is created. Its content gets populated by the following information (only one, in priority order) :

  • the <text> node of the DataStore (if set)
  • the resource name

XML Sample

Sample configuration

<queryonclick>
  <name>W_MyQueryOnClick</name>
  <options>
    <results>
      <result>W_MyResultExtGrid</result>
    </results>
  </options>
</queryonclick>

Having a single <result> tag if only one result is used by the widget is also okay :

<queryonclick>
  <name>W_MyQueryOnClick</name>
  <options>
    <result>W_MyResultExtGrid</result>
  </options>
</queryonclick>

Configuration with “resetOnDeactivation” set to all

<queryonclick>
  <name>W_MyQueryOnClick</name>
  <options>
    <resetOnDeactivation>all</resetOnDeactivation>
    <results>
      <result>W_MyResultExtGrid</result>
    </results>
  </options>
</queryonclick>

Configuration using a specific marker

<queryonclick>
  <name>W_MyQueryOnClick</name>
  <options>
    <markerStyle>
      <graphicWidth>42</graphicWidth>
      <graphicHeight>50</graphicHeight>
      <graphicYOffset>-50</graphicYOffset>
      <externalGraphic>/path/to/otherMarker.gif</externalGraphic>
    </markerStyle>
    <results>
      <result>W_MyResultExtGrid</result>
    </results>
  </options>
</queryonclick>

XML Sample - widget to be added to a toolbar

This widget must be added to a GeoExtToolbar widget

<geoexttoolbar>
  <name>W_GeoExtToolbar</name>
  <options>
    <widgets>
      <widget>W_MyQueryOnClick</widget>
    </widgets>
  </options>
</geoexttoolbar>

Mandatory Options

results:Contains <result> tags if you wish to use more than one result. Either ‘results’ or ‘result’ is mandatory.
result:Name of a result widget that will be used to contain the features returned by a query. Can only be used if one result is used by the query. Either ‘results’ or ‘result’ is mandatory.
results/result:If you want to have more than one result, you must define them in <results> tag.

Optional Options

resetOnDeactivation:
 

Determine what to reset when the widget gets deactivated. By default (when this option is ommited), it’s automatically set to “marker”. You can set this option to (case sensitive):

  • marker : (removes only the query marker)
  • nothing : (removes nothing)
  • all : (removes the marker and reset the query results)
markerStyle:

To change the style of the marker that appears on map click. Must contains Vector Features Symbolizer properties nodes (see OpenLayers/lib/OpenLayers/Feature/Vector.js). See an example in the samples above.

dropDownList:

Can be set to true or false. Default value is true if ommited. Creates a SplitButton object if set to true instead of a regular button.

noMarker:

Can be set to true or false. Default value is false if ommited. Skip the creation of the markerLayer object resulting in adding no marker when the map is clicked if this option is set to true.

Service Type

wms

Widget Action

read

Table Of Contents

Previous topic

PopUp (deprecated)

Next topic

QuickZoom (deprecated)

This Page