Remove end-of-line whitespace.
The license header is left untouched, to keep it the same in all files. A seperate commit will probably deal with this
This commit is contained in:
@@ -15,10 +15,10 @@
|
|||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.WMSGetFeatureInfo
|
* Class: OpenLayers.Control.WMSGetFeatureInfo
|
||||||
* The WMSGetFeatureInfo control uses a WMS query to get information about a point on the map. The
|
* The WMSGetFeatureInfo control uses a WMS query to get information about a point on the map. The
|
||||||
* information may be in a display-friendly format such as HTML, or a machine-friendly format such
|
* information may be in a display-friendly format such as HTML, or a machine-friendly format such
|
||||||
* as GML, depending on the server's capabilities and the client's configuration. This control
|
* as GML, depending on the server's capabilities and the client's configuration. This control
|
||||||
* handles click or hover events, attempts to parse the results using an OpenLayers.Format, and
|
* handles click or hover events, attempts to parse the results using an OpenLayers.Format, and
|
||||||
* fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an
|
* fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an
|
||||||
* array of features if it successfully read the response.
|
* array of features if it successfully read the response.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
@@ -56,7 +56,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* option is set to false. Default is "click".
|
* option is set to false. Default is "click".
|
||||||
*/
|
*/
|
||||||
clickCallback: "click",
|
clickCallback: "click",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: output
|
* APIProperty: output
|
||||||
* {String} Either "features" or "object". When triggering a getfeatureinfo
|
* {String} Either "features" or "object". When triggering a getfeatureinfo
|
||||||
@@ -65,7 +65,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* WMS). Default is "features".
|
* WMS). Default is "features".
|
||||||
*/
|
*/
|
||||||
output: "features",
|
output: "features",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: layers
|
* APIProperty: layers
|
||||||
* {Array(<OpenLayers.Layer.WMS>)} The layers to query for feature info.
|
* {Array(<OpenLayers.Layer.WMS>)} The layers to query for feature info.
|
||||||
@@ -87,7 +87,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* of the first eligible layer will be used.
|
* of the first eligible layer will be used.
|
||||||
*/
|
*/
|
||||||
url: null,
|
url: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: layerUrls
|
* APIProperty: layerUrls
|
||||||
* {Array(String)} Optional list of urls for layers that should be queried.
|
* {Array(String)} Optional list of urls for layers that should be queried.
|
||||||
@@ -105,7 +105,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* INFO_FORMAT parameter in your <OpenLayers.Layer.WMS> instance(s).
|
* INFO_FORMAT parameter in your <OpenLayers.Layer.WMS> instance(s).
|
||||||
*/
|
*/
|
||||||
infoFormat: 'text/html',
|
infoFormat: 'text/html',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: vendorParams
|
* APIProperty: vendorParams
|
||||||
* {Object} Additional parameters that will be added to the request, for
|
* {Object} Additional parameters that will be added to the request, for
|
||||||
@@ -117,14 +117,14 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* (end)
|
* (end)
|
||||||
*/
|
*/
|
||||||
vendorParams: {},
|
vendorParams: {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: format
|
* APIProperty: format
|
||||||
* {<OpenLayers.Format>} A format for parsing GetFeatureInfo responses.
|
* {<OpenLayers.Format>} A format for parsing GetFeatureInfo responses.
|
||||||
* Default is <OpenLayers.Format.WMSGetFeatureInfo>.
|
* Default is <OpenLayers.Format.WMSGetFeatureInfo>.
|
||||||
*/
|
*/
|
||||||
format: null,
|
format: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: formatOptions
|
* APIProperty: formatOptions
|
||||||
* {Object} Optional properties to set on the format (if one is not provided
|
* {Object} Optional properties to set on the format (if one is not provided
|
||||||
@@ -142,21 +142,21 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* }
|
* }
|
||||||
* (end)
|
* (end)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: handler
|
* Property: handler
|
||||||
* {Object} Reference to the <OpenLayers.Handler> for this control
|
* {Object} Reference to the <OpenLayers.Handler> for this control
|
||||||
*/
|
*/
|
||||||
handler: null,
|
handler: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: hoverRequest
|
* Property: hoverRequest
|
||||||
* {<OpenLayers.Request>} contains the currently running hover request
|
* {<OpenLayers.Request>} contains the currently running hover request
|
||||||
* (if any).
|
* (if any).
|
||||||
*/
|
*/
|
||||||
hoverRequest: null,
|
hoverRequest: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: events
|
* APIProperty: events
|
||||||
* {<OpenLayers.Events>} Events instance for listeners and triggering
|
* {<OpenLayers.Events>} Events instance for listeners and triggering
|
||||||
* control specific events.
|
* control specific events.
|
||||||
@@ -168,7 +168,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
*
|
*
|
||||||
* Supported event types (in addition to those from <OpenLayers.Control.events>):
|
* Supported event types (in addition to those from <OpenLayers.Control.events>):
|
||||||
* beforegetfeatureinfo - Triggered before the request is sent.
|
* beforegetfeatureinfo - Triggered before the request is sent.
|
||||||
* The event object has an *xy* property with the position of the
|
* The event object has an *xy* property with the position of the
|
||||||
* mouse click or hover event that triggers the request.
|
* mouse click or hover event that triggers the request.
|
||||||
* nogetfeatureinfo - no queryable layers were found.
|
* nogetfeatureinfo - no queryable layers were found.
|
||||||
* getfeatureinfo - Triggered when a GetFeatureInfo response is received.
|
* getfeatureinfo - Triggered when a GetFeatureInfo response is received.
|
||||||
@@ -186,20 +186,20 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
|
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* options - {Object}
|
* options - {Object}
|
||||||
*/
|
*/
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
options.handlerOptions = options.handlerOptions || {};
|
options.handlerOptions = options.handlerOptions || {};
|
||||||
|
|
||||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||||
|
|
||||||
if(!this.format) {
|
if(!this.format) {
|
||||||
this.format = new OpenLayers.Format.WMSGetFeatureInfo(
|
this.format = new OpenLayers.Format.WMSGetFeatureInfo(
|
||||||
options.formatOptions
|
options.formatOptions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.drillDown === true) {
|
if(this.drillDown === true) {
|
||||||
this.hover = false;
|
this.hover = false;
|
||||||
}
|
}
|
||||||
@@ -222,11 +222,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: getInfoForClick
|
* Method: getInfoForClick
|
||||||
* Called on click
|
* Called on click
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* evt - {<OpenLayers.Event>}
|
* evt - {<OpenLayers.Event>}
|
||||||
*/
|
*/
|
||||||
getInfoForClick: function(evt) {
|
getInfoForClick: function(evt) {
|
||||||
this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy});
|
this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy});
|
||||||
@@ -235,7 +235,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
|
OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
|
||||||
this.request(evt.xy, {});
|
this.request(evt.xy, {});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: getInfoForHover
|
* Method: getInfoForHover
|
||||||
* Pause callback for the hover handler
|
* Pause callback for the hover handler
|
||||||
@@ -286,7 +286,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
}
|
}
|
||||||
return layers;
|
return layers;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: urlMatches
|
* Method: urlMatches
|
||||||
* Test to see if the provided url matches either the control <url> or one
|
* Test to see if the provided url matches either the control <url> or one
|
||||||
@@ -385,7 +385,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* Method: getStyleNames
|
* Method: getStyleNames
|
||||||
* Gets the STYLES parameter for the layer. Make sure the STYLES parameter
|
* Gets the STYLES parameter for the layer. Make sure the STYLES parameter
|
||||||
* matches the LAYERS parameter
|
* matches the LAYERS parameter
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* layer - {<OpenLayers.Layer.WMS>}
|
* layer - {<OpenLayers.Layer.WMS>}
|
||||||
*
|
*
|
||||||
@@ -413,12 +413,12 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
/**
|
/**
|
||||||
* Method: request
|
* Method: request
|
||||||
* Sends a GetFeatureInfo request to the WMS
|
* Sends a GetFeatureInfo request to the WMS
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* clickPosition - {<OpenLayers.Pixel>} The position on the map where the
|
* clickPosition - {<OpenLayers.Pixel>} The position on the map where the
|
||||||
* mouse event occurred.
|
* mouse event occurred.
|
||||||
* options - {Object} additional options for this method.
|
* options - {Object} additional options for this method.
|
||||||
*
|
*
|
||||||
* Valid options:
|
* Valid options:
|
||||||
* - *hover* {Boolean} true if we do the request for the hover handler
|
* - *hover* {Boolean} true if we do the request for the hover handler
|
||||||
*/
|
*/
|
||||||
@@ -430,13 +430,13 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if(this.drillDown === false) {
|
if(this.drillDown === false) {
|
||||||
var wmsOptions = this.buildWMSOptions(this.url, layers,
|
var wmsOptions = this.buildWMSOptions(this.url, layers,
|
||||||
clickPosition, layers[0].params.FORMAT);
|
clickPosition, layers[0].params.FORMAT);
|
||||||
var request = OpenLayers.Request.GET(wmsOptions);
|
var request = OpenLayers.Request.GET(wmsOptions);
|
||||||
|
|
||||||
if (options.hover === true) {
|
if (options.hover === true) {
|
||||||
this.hoverRequest = request;
|
this.hoverRequest = request;
|
||||||
}
|
}
|
||||||
@@ -460,9 +460,9 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
var layers;
|
var layers;
|
||||||
for (var url in services) {
|
for (var url in services) {
|
||||||
layers = services[url];
|
layers = services[url];
|
||||||
var wmsOptions = this.buildWMSOptions(url, layers,
|
var wmsOptions = this.buildWMSOptions(url, layers,
|
||||||
clickPosition, layers[0].params.FORMAT);
|
clickPosition, layers[0].params.FORMAT);
|
||||||
OpenLayers.Request.GET(wmsOptions);
|
OpenLayers.Request.GET(wmsOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -490,11 +490,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
// Reset the cursor.
|
// Reset the cursor.
|
||||||
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: handleResponse
|
* Method: handleResponse
|
||||||
* Handler for the GetFeatureInfo response.
|
* Handler for the GetFeatureInfo response.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* xy - {<OpenLayers.Pixel>} The position on the map where the
|
* xy - {<OpenLayers.Pixel>} The position on the map where the
|
||||||
* mouse event occurred.
|
* mouse event occurred.
|
||||||
@@ -502,7 +502,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* url - {String} The url which was used for this request.
|
* url - {String} The url which was used for this request.
|
||||||
*/
|
*/
|
||||||
handleResponse: function(xy, request, url) {
|
handleResponse: function(xy, request, url) {
|
||||||
|
|
||||||
var doc = request.responseXML;
|
var doc = request.responseXML;
|
||||||
if(!doc || !doc.documentElement) {
|
if(!doc || !doc.documentElement) {
|
||||||
doc = request.responseText;
|
doc = request.responseText;
|
||||||
@@ -520,7 +520,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
this._features = (this._features || []).concat(features);
|
this._features = (this._features || []).concat(features);
|
||||||
}
|
}
|
||||||
if (this._requestCount === this._numRequests) {
|
if (this._requestCount === this._numRequests) {
|
||||||
this.triggerGetFeatureInfo(request, xy, this._features.concat());
|
this.triggerGetFeatureInfo(request, xy, this._features.concat());
|
||||||
delete this._features;
|
delete this._features;
|
||||||
delete this._requestCount;
|
delete this._requestCount;
|
||||||
delete this._numRequests;
|
delete this._numRequests;
|
||||||
|
|||||||
Reference in New Issue
Block a user