Merge pull request #885 from ahocevar/wms-getfeatureinfo

Implement WMS GetFeatureInfo
This commit is contained in:
ahocevar
2013-08-08 07:44:04 -07:00
14 changed files with 368 additions and 38 deletions
+20
View File
@@ -73,6 +73,26 @@ ol.renderer.Layer = function(mapRenderer, layer) {
goog.inherits(ol.renderer.Layer, goog.Disposable);
/**
* @param {ol.Pixel} pixel Pixel coordinate relative to the map viewport.
* @param {function(string, ol.layer.Layer)} success Callback for
* successful queries. The passed arguments are the resulting feature
* information and the layer.
* @param {function()=} opt_error Callback for unsuccessful queries.
*/
ol.renderer.Layer.prototype.getFeatureInfoForPixel =
function(pixel, success, opt_error) {
var layer = this.getLayer();
var source = layer.getSource();
if (goog.isFunction(source.getFeatureInfoForPixel)) {
var callback = function(layerFeatureInfo) {
success(layerFeatureInfo, layer);
};
source.getFeatureInfoForPixel(pixel, this.getMap(), callback, opt_error);
}
};
/**
* @protected
* @return {ol.layer.Layer} Layer.
+2 -2
View File
@@ -106,7 +106,7 @@ ol.renderer.Map.prototype.getCanvas = goog.functions.NULL;
* information. Layers that are able to provide attribute data will put
* ol.Feature instances, other layers will put a string which can either
* be plain text or markup.
* @param {function(Object)=} opt_error Callback for unsuccessful
* @param {function()=} opt_error Callback for unsuccessful
* queries.
*/
ol.renderer.Map.prototype.getFeatureInfoForPixel =
@@ -142,7 +142,7 @@ ol.renderer.Map.prototype.getFeatureInfoForPixel =
* information. Layers that are able to provide attribute data will put
* ol.Feature instances, other layers will put a string which can either
* be plain text or markup.
* @param {function(Object)=} opt_error Callback for unsuccessful
* @param {function()=} opt_error Callback for unsuccessful
* queries.
*/
ol.renderer.Map.prototype.getFeaturesForPixel =