OpenLayers.Control.QueryByRect

Inherits From

  • <OpenLayers.Control>
Summary
OpenLayers.Control.QueryByRect
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
filterType{<String>} The type of filter to use when sending off a request.
APIProperty: drawMode{string}
queryablelayers{Array(String)} Layers that are queryable with GetFeatureInfo requests
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.
progressBar{Ext.ProgressBar}
Functions
OpenLayers.Control.QueryByRectCreate a new QueryByRect control.
getResourceNameByLayerReturns the resource name of a layer given a service type.
selectBoxCallback from the handlers.box set up when <box> selection is on
request
getFeaturesRetreive the features from the query response and add them to this.features.
resetResultsReset all results content.
resetQueryDataReset all properties used for a query and reset all result panels.
showResultIf results were found 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.
pixelToBoundsTakes a pixel as argument and creates bounds after adding the <clickTolerance>.
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

filterType

{<String>} The type of filter to use when sending off a request.  Possible values: OpenLayers.Filter.Spatial.<BBOX|INTERSECTS|WITHIN|CONTAINS> Defaults to: OpenLayers.Filter.Spatial.BBOX

APIProperty: drawMode

{string}

queryablelayers

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

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.

progressBar

{Ext.ProgressBar}

Functions

OpenLayers.Control.QueryByRect

Create a new QueryByRect 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

selectBox

selectBox: function(position)

Callback from the handlers.box set up when <box> selection is on

Parameters

position{<OpenLayers.Bounds>}

request

request: function(bounds)

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

resetResults

resetResults: function()

Reset all results content.

resetQueryData

resetQueryData: function()

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

showResult

showResult: function()

If results were found 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.

pixelToBounds

pixelToBounds: function(pixel)

Takes a pixel as argument and creates bounds after adding the <clickTolerance>.

Parameters

pixel{<OpenLayers.Pixel>}

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.
selectBox: function(position)
Callback from the handlers.box set up when box selection is on
request: function(bounds)
getFeatures: function(response,
resource)
Retreive the features from the query response and add them to this.features.
resetResults: function()
Reset all results content.
resetQueryData: function()
Reset all properties used for a query and reset all result panels.
showResult: function()
If results were found 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.
pixelToBounds: function(pixel)
Takes a pixel as argument and creates bounds after adding the clickTolerance.
showMessage: function(title,
message,
icon)
Display a Ext.MessageBox and hide it after 2 seconds.
Close