OpenLayers.Control.QueryOnClick

Inherits From

  • <OpenLayers.Control>
Summary
OpenLayers.Control.QueryOnClick
Constants
DEFAULT_PARAMS{Object} Hashtable of default parameter key/value pairs
i18n_wait_options_msg{String} Wait msg
i18n_wait_options_progress_text{String} Wait progress text
i18n_wait_options_completed_text{String} Completed :
i18n_wait_options_of_text{String} of
i18n_no_layer_queryable{String} No layer is queryable
i18n_warning{String} Warning text
i18n_message_no_result_msg{String} No result message
i18n_message_no_result_title{String} No result title
Properties
APIProperty: drawMode{string}
queryablelayers{Array(String)} Layers that are queryable with GetFeatureInfo requests
markerLayer{<OpenLayers.Layer.Vector>} Layer used to point a marker where the user clicked.
marker{<OpenLayers.Feature.Vector>} Point feature created/updated on click
results{Array(<Openlayer.Result>)} An array of Result objects used to render the results of the query.
queries{Integer} The number of queries received.
errors{Integer} When an error occurs on the response of a query, this number is incremented.
features{Array(<OpenLayers.Feature>)} Array of features created from the responses received.
features{Array(String)} Array of html results returned by queries using ‘text/html’ info_format parameter.
featurepanels{Array(<OpenLayers.FeaturePanel>)} Array of FeaturePanel objects used to render the results of the query.
getFeaturesResource{Array(Functions)} Array of functions to forward the resource to getFeatures.
DEFAULT_MARKER_STYLE{Object} Used for the StyleMap for the markerLayer if no markerStyle is providen.
progressBar{Ext.ProgressBar}
modifiers{Object} The event modifiers to use, according to the current event being handled by this control’s handlers
Functions
OpenLayers.Control.QueryOnClickCreate a new QueryOnClick control.
getResourceNameByLayerReturns the resource name of a layer given a service type.
onClickCalled by this click handler when the user click the map.
getFeaturesRetreive the features from the query response and add them to this.features.
onErrorCalled when an error occurs with the AJAX request
removeMarkerRemove the query marker from the map.
resetResultsReset all results content.
resetQueryDataReset all properties used for a query and reset all result panels.
resetQueryDataReset ‘feature-related’ properties, such as : removing markers, reseting features and htmlResults
showResultIf results were found, add a marker where the user clicked and call each result “showResult” function.
showWaitMessageBoxShows a “wait message” in a Ext.Window with a ProgressBar.
hideWaitMessageBoxHides the “wait message” Ext.Window.
updateProgressBarUpdate the “wait message” window with the current queries completed.
setMapSet the map property for the control and all handlers.
getResourceByNameReturns the resource object inside this widget using its name.
setModifiersSets the multiple modifiers according to the current event
showMessageDisplay a Ext.MessageBox and hide it after 2 seconds.

Constants

DEFAULT_PARAMS

{Object} Hashtable of default parameter key/value pairs

i18n_wait_options_msg

{String} Wait msg

i18n_wait_options_progress_text

{String} Wait progress text

i18n_wait_options_completed_text

{String} Completed :

i18n_wait_options_of_text

{String} of

i18n_no_layer_queryable

{String} No layer is queryable

i18n_warning

{String} Warning text

i18n_message_no_result_msg

{String} No result message

i18n_message_no_result_title

{String} No result title

Properties

APIProperty: drawMode

{string}

queryablelayers

{Array(String)} Layers that are queryable with GetFeatureInfo requests

markerLayer

{<OpenLayers.Layer.Vector>} Layer used to point a marker where the user clicked.

marker

{<OpenLayers.Feature.Vector>} Point feature created/updated on click

results

{Array(<Openlayer.Result>)} An array of Result objects used to render the results of the query.

queries

{Integer} The number of queries received.  As soon as this number is equal to the length of the resourcestoquery array, that means all responses were received.

errors

{Integer} When an error occurs on the response of a query, this number is incremented.

features

{Array(<OpenLayers.Feature>)} Array of features created from the responses received.

features

{Array(String)} Array of html results returned by queries using ‘text/html’ info_format parameter.

featurepanels

{Array(<OpenLayers.FeaturePanel>)} Array of FeaturePanel objects used to render the results of the query.

getFeaturesResource

{Array(Functions)} Array of functions to forward the resource to getFeatures.

DEFAULT_MARKER_STYLE

{Object} Used for the StyleMap for the markerLayer if no markerStyle is providen.

progressBar

{Ext.ProgressBar}

modifiers

{Object} The event modifiers to use, according to the current event being handled by this control’s handlers

Functions

OpenLayers.Control.QueryOnClick

Create a new QueryOnClick control.

Parameters

options{Object} Optional object whose properties will be set on the control.

getResourceNameByLayer

getResourceNameByLayer: function(szLayer,
szServiceType)

Returns the resource name of a layer given a service type.

Parameters

szLayer{String} The server-side layer name
szServiceType{String} The service type (i.e.  “wms”)

Returns

{String} The resource name

onClick

onClick: function(evt)

Called by this click handler when the user click the map.

First, the current query data is reset and all result panels are reset too.  Second, each resources are validated : is there a layer currently visible that has the resource ? Third, all queryable resource builds a query and send it.

getFeatures

getFeatures: function(response,
resource)

Retreive the features from the query response and add them to this.features.  The number of result received is incremented (this.queries).  When the last result is received, the method showResult is called.

Parameters

response{AJAX} Ajax response
resource{String} Name of the resource

onError

onError: function(response)

Called when an error occurs with the AJAX request

Parameters

response{AJAX response}

removeMarker

removeMarker: function()

Remove the query marker from the map.

resetResults

resetResults: function(options)

Reset all results content.

options{<Object>} Hash of options.  Possible keys are :
  • modifiers : the query modifiers

resetQueryData

resetQueryData: function(options)

Reset all properties used for a query and reset all result panels.

options{<Object>} Hash of options.  Possible keys are :
  • modifiers : the query modifiers

resetQueryData

Reset ‘feature-related’ properties, such as : removing markers, reseting features and htmlResults

showResult

showResult: function()

If results were found, add a marker where the user clicked and call each result “showResult” function.

showWaitMessageBox

showWaitMessageBox: function()

Shows a “wait message” in a Ext.Window with a ProgressBar.

hideWaitMessageBox

hideWaitMessageBox: function()

Hides the “wait message” Ext.Window.

updateProgressBar

updateProgressBar: function()

Update the “wait message” window with the current queries completed.

setMap

setMap: function(map)

Set the map property for the control and all handlers.

Parameters

map{<OpenLayers.Map>} The control’s map.

getResourceByName

getResourceByName: function(resourceName)

Returns the resource object inside this widget using its name.  If not found, returns false.

Parameters

resourceName{String} The name of the resource to look for

Return

{Object} The resource object contained in this widget or false if not found.

setModifiers

setModifiers: function(evt)

Sets the multiple modifiers according to the current event

Parameters

evt {<OpenLayers.Event>}

showMessage

showMessage: function(title,
message,
icon)

Display a Ext.MessageBox and hide it after 2 seconds.

Parameters

title{String} Title of the message
message{String} The message
icon{String} The ext icon to use in the message box
getResourceNameByLayer: function(szLayer,
szServiceType)
Returns the resource name of a layer given a service type.
onClick: function(evt)
Called by this click handler when the user click the map.
getFeatures: function(response,
resource)
Retreive the features from the query response and add them to this.features.
onError: function(response)
Called when an error occurs with the AJAX request
removeMarker: function()
Remove the query marker from the map.
resetResults: function(options)
Reset all results content.
resetQueryData: function(options)
Reset all properties used for a query and reset all result panels.
showResult: function()
If results were found, add a marker where the user clicked and call each result “showResult” function.
showWaitMessageBox: function()
Shows a “wait message” in a Ext.Window with a ProgressBar.
hideWaitMessageBox: function()
Hides the “wait message” Ext.Window.
updateProgressBar: function()
Update the “wait message” window with the current queries completed.
setMap: function(map)
Set the map property for the control and all handlers.
getResourceByName: function(resourceName)
Returns the resource object inside this widget using its name.
setModifiers: function(evt)
Sets the multiple modifiers according to the current event
showMessage: function(title,
message,
icon)
Display a Ext.MessageBox and hide it after 2 seconds.
Close