Make signature for *AtPixel methods more consistent
pixel/coordinate is the first argument.
This commit is contained in:
@@ -1858,16 +1858,16 @@ ol.render.canvas.ReplayGroup.prototype.finish = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {number} rotation Rotation.
|
* @param {number} rotation Rotation.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
|
||||||
* @param {Object} skippedFeaturesHash Ids of features to skip
|
* @param {Object} skippedFeaturesHash Ids of features to skip
|
||||||
* @param {function(ol.Feature): T} callback Feature callback.
|
* @param {function(ol.Feature): T} callback Feature callback.
|
||||||
* @return {T|undefined} Callback result.
|
* @return {T|undefined} Callback result.
|
||||||
* @template T
|
* @template T
|
||||||
*/
|
*/
|
||||||
ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
||||||
resolution, rotation, coordinate, skippedFeaturesHash, callback) {
|
coordinate, resolution, rotation, skippedFeaturesHash, callback) {
|
||||||
|
|
||||||
var transform = this.hitDetectionTransform_;
|
var transform = this.hitDetectionTransform_;
|
||||||
ol.vec.Mat4.makeTransform2D(transform, 0.5, 0.5,
|
ol.vec.Mat4.makeTransform2D(transform, 0.5, 0.5,
|
||||||
|
|||||||
@@ -1154,6 +1154,7 @@ ol.render.webgl.ReplayGroup.prototype.replayHitDetection_ = function(context,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {ol.webgl.Context} context Context.
|
* @param {ol.webgl.Context} context Context.
|
||||||
* @param {ol.Coordinate} center Center.
|
* @param {ol.Coordinate} center Center.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
@@ -1166,15 +1167,14 @@ ol.render.webgl.ReplayGroup.prototype.replayHitDetection_ = function(context,
|
|||||||
* @param {number} hue Global hue.
|
* @param {number} hue Global hue.
|
||||||
* @param {number} saturation Global saturation.
|
* @param {number} saturation Global saturation.
|
||||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
|
||||||
* @param {function(ol.Feature): T|undefined} callback Feature callback.
|
* @param {function(ol.Feature): T|undefined} callback Feature callback.
|
||||||
* @return {T|undefined} Callback result.
|
* @return {T|undefined} Callback result.
|
||||||
* @template T
|
* @template T
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
||||||
context, center, resolution, rotation, size, pixelRatio,
|
coordinate, context, center, resolution, rotation, size, pixelRatio,
|
||||||
opacity, brightness, contrast, hue, saturation, skippedFeaturesHash,
|
opacity, brightness, contrast, hue, saturation, skippedFeaturesHash,
|
||||||
coordinate, callback) {
|
callback) {
|
||||||
var gl = context.getGL();
|
var gl = context.getGL();
|
||||||
gl.bindFramebuffer(
|
gl.bindFramebuffer(
|
||||||
gl.FRAMEBUFFER, context.getHitDetectionFramebuffer());
|
gl.FRAMEBUFFER, context.getHitDetectionFramebuffer());
|
||||||
@@ -1215,6 +1215,7 @@ ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {ol.webgl.Context} context Context.
|
* @param {ol.webgl.Context} context Context.
|
||||||
* @param {ol.Coordinate} center Center.
|
* @param {ol.Coordinate} center Center.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
@@ -1227,13 +1228,11 @@ ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function(
|
|||||||
* @param {number} hue Global hue.
|
* @param {number} hue Global hue.
|
||||||
* @param {number} saturation Global saturation.
|
* @param {number} saturation Global saturation.
|
||||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
|
||||||
* @return {boolean} Is there a feature at the given pixel?
|
* @return {boolean} Is there a feature at the given pixel?
|
||||||
*/
|
*/
|
||||||
ol.render.webgl.ReplayGroup.prototype.hasFeatureAtPixel = function(
|
ol.render.webgl.ReplayGroup.prototype.hasFeatureAtPixel = function(
|
||||||
context, center, resolution, rotation, size, pixelRatio,
|
coordinate, context, center, resolution, rotation, size, pixelRatio,
|
||||||
opacity, brightness, contrast, hue, saturation, skippedFeaturesHash,
|
opacity, brightness, contrast, hue, saturation, skippedFeaturesHash) {
|
||||||
coordinate) {
|
|
||||||
var gl = context.getGL();
|
var gl = context.getGL();
|
||||||
gl.bindFramebuffer(
|
gl.bindFramebuffer(
|
||||||
gl.FRAMEBUFFER, context.getHitDetectionFramebuffer());
|
gl.FRAMEBUFFER, context.getHitDetectionFramebuffer());
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var rotation = frameState.viewState.rotation;
|
var rotation = frameState.viewState.rotation;
|
||||||
var skippedFeatureUids = frameState.skippedFeatureUids;
|
var skippedFeatureUids = frameState.skippedFeatureUids;
|
||||||
return source.forEachFeatureAtPixel(
|
return source.forEachFeatureAtPixel(
|
||||||
resolution, rotation, coordinate, skippedFeatureUids,
|
coordinate, resolution, rotation, skippedFeatureUids,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var layer = this.getLayer();
|
var layer = this.getLayer();
|
||||||
/** @type {Object.<string, boolean>} */
|
/** @type {Object.<string, boolean>} */
|
||||||
var features = {};
|
var features = {};
|
||||||
return this.replayGroup_.forEachFeatureAtPixel(resolution,
|
return this.replayGroup_.forEachFeatureAtPixel(coordinate,
|
||||||
rotation, coordinate, frameState.skippedFeatureUids,
|
resolution, rotation, frameState.skippedFeatureUids,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var rotation = frameState.viewState.rotation;
|
var rotation = frameState.viewState.rotation;
|
||||||
var skippedFeatureUids = frameState.skippedFeatureUids;
|
var skippedFeatureUids = frameState.skippedFeatureUids;
|
||||||
return source.forEachFeatureAtPixel(
|
return source.forEachFeatureAtPixel(
|
||||||
resolution, rotation, coordinate, skippedFeatureUids,
|
coordinate, resolution, rotation, skippedFeatureUids,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var layer = this.getLayer();
|
var layer = this.getLayer();
|
||||||
/** @type {Object.<string, boolean>} */
|
/** @type {Object.<string, boolean>} */
|
||||||
var features = {};
|
var features = {};
|
||||||
return this.replayGroup_.forEachFeatureAtPixel(resolution,
|
return this.replayGroup_.forEachFeatureAtPixel(coordinate,
|
||||||
rotation, coordinate, frameState.skippedFeatureUids,
|
resolution, rotation, frameState.skippedFeatureUids,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ ol.renderer.Map.prototype.forEachFeatureAtPixel =
|
|||||||
if (!goog.isNull(this.replayGroup)) {
|
if (!goog.isNull(this.replayGroup)) {
|
||||||
/** @type {Object.<string, boolean>} */
|
/** @type {Object.<string, boolean>} */
|
||||||
var features = {};
|
var features = {};
|
||||||
result = this.replayGroup.forEachFeatureAtPixel(viewResolution,
|
result = this.replayGroup.forEachFeatureAtPixel(coordinate,
|
||||||
viewRotation, coordinate, {},
|
viewResolution, viewRotation, {},
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
@@ -192,8 +192,8 @@ ol.renderer.Map.prototype.forEachLayerAtPixel =
|
|||||||
var viewRotation = viewState.rotation;
|
var viewRotation = viewState.rotation;
|
||||||
|
|
||||||
if (!goog.isNull(this.replayGroup)) {
|
if (!goog.isNull(this.replayGroup)) {
|
||||||
var hasFeature = this.replayGroup.forEachFeatureAtPixel(viewResolution,
|
var hasFeature = this.replayGroup.forEachFeatureAtPixel(coordinate,
|
||||||
viewRotation, coordinate, {}, goog.functions.TRUE);
|
viewResolution, viewRotation, {}, goog.functions.TRUE);
|
||||||
|
|
||||||
if (hasFeature) {
|
if (hasFeature) {
|
||||||
result = callback.call(thisArg, null);
|
result = callback.call(thisArg, null);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var rotation = frameState.viewState.rotation;
|
var rotation = frameState.viewState.rotation;
|
||||||
var skippedFeatureUids = frameState.skippedFeatureUids;
|
var skippedFeatureUids = frameState.skippedFeatureUids;
|
||||||
return source.forEachFeatureAtPixel(
|
return source.forEachFeatureAtPixel(
|
||||||
resolution, rotation, coordinate, skippedFeatureUids,
|
coordinate, resolution, rotation, skippedFeatureUids,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
|
|||||||
@@ -560,11 +560,10 @@ ol.renderer.webgl.Map.prototype.forEachFeatureAtPixel =
|
|||||||
// use default color values
|
// use default color values
|
||||||
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
||||||
|
|
||||||
result = this.replayGroup.forEachFeatureAtPixel(context,
|
result = this.replayGroup.forEachFeatureAtPixel(coordinate,
|
||||||
viewState.center, viewState.resolution, viewState.rotation,
|
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||||
frameState.size, frameState.pixelRatio,
|
frameState.size, frameState.pixelRatio,
|
||||||
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {},
|
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {},
|
||||||
coordinate,
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
@@ -620,11 +619,10 @@ ol.renderer.webgl.Map.prototype.hasFeatureAtPixel =
|
|||||||
// use default color values
|
// use default color values
|
||||||
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
||||||
|
|
||||||
hasFeature = this.replayGroup.hasFeatureAtPixel(context,
|
hasFeature = this.replayGroup.hasFeatureAtPixel(coordinate,
|
||||||
viewState.center, viewState.resolution, viewState.rotation,
|
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||||
frameState.size, frameState.pixelRatio,
|
frameState.size, frameState.pixelRatio,
|
||||||
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {},
|
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {});
|
||||||
coordinate);
|
|
||||||
if (hasFeature) {
|
if (hasFeature) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -667,11 +665,10 @@ ol.renderer.webgl.Map.prototype.forEachLayerAtPixel =
|
|||||||
// use default color values
|
// use default color values
|
||||||
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_;
|
||||||
|
|
||||||
var hasFeature = this.replayGroup.hasFeatureAtPixel(context,
|
var hasFeature = this.replayGroup.hasFeatureAtPixel(coordinate,
|
||||||
viewState.center, viewState.resolution, viewState.rotation,
|
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||||
frameState.size, frameState.pixelRatio,
|
frameState.size, frameState.pixelRatio,
|
||||||
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {},
|
d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {});
|
||||||
coordinate);
|
|
||||||
if (hasFeature) {
|
if (hasFeature) {
|
||||||
result = callback.call(thisArg, null);
|
result = callback.call(thisArg, null);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|||||||
@@ -118,12 +118,11 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtPixel =
|
|||||||
var layerState = this.layerState_;
|
var layerState = this.layerState_;
|
||||||
/** @type {Object.<string, boolean>} */
|
/** @type {Object.<string, boolean>} */
|
||||||
var features = {};
|
var features = {};
|
||||||
return this.replayGroup_.forEachFeatureAtPixel(context,
|
return this.replayGroup_.forEachFeatureAtPixel(coordinate,
|
||||||
viewState.center, viewState.resolution, viewState.rotation,
|
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||||
frameState.size, frameState.pixelRatio,
|
frameState.size, frameState.pixelRatio,
|
||||||
layerState.opacity, layerState.brightness, layerState.contrast,
|
layerState.opacity, layerState.brightness, layerState.contrast,
|
||||||
layerState.hue, layerState.saturation, frameState.skippedFeatureUids,
|
layerState.hue, layerState.saturation, frameState.skippedFeatureUids,
|
||||||
coordinate,
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
@@ -152,12 +151,11 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtPixel =
|
|||||||
var context = mapRenderer.getContext();
|
var context = mapRenderer.getContext();
|
||||||
var viewState = frameState.viewState;
|
var viewState = frameState.viewState;
|
||||||
var layerState = this.layerState_;
|
var layerState = this.layerState_;
|
||||||
return this.replayGroup_.hasFeatureAtPixel(context,
|
return this.replayGroup_.hasFeatureAtPixel(coordinate,
|
||||||
viewState.center, viewState.resolution, viewState.rotation,
|
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||||
frameState.size, frameState.pixelRatio,
|
frameState.size, frameState.pixelRatio,
|
||||||
layerState.opacity, layerState.brightness, layerState.contrast,
|
layerState.opacity, layerState.brightness, layerState.contrast,
|
||||||
layerState.hue, layerState.saturation, frameState.skippedFeatureUids,
|
layerState.hue, layerState.saturation, frameState.skippedFeatureUids);
|
||||||
coordinate);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -153,14 +153,14 @@ ol.source.ImageVector.prototype.canvasFunctionInternal_ =
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.source.ImageVector.prototype.forEachFeatureAtPixel = function(
|
ol.source.ImageVector.prototype.forEachFeatureAtPixel = function(
|
||||||
resolution, rotation, coordinate, skippedFeatureUids, callback) {
|
coordinate, resolution, rotation, skippedFeatureUids, callback) {
|
||||||
if (goog.isNull(this.replayGroup_)) {
|
if (goog.isNull(this.replayGroup_)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
} else {
|
} else {
|
||||||
/** @type {Object.<string, boolean>} */
|
/** @type {Object.<string, boolean>} */
|
||||||
var features = {};
|
var features = {};
|
||||||
return this.replayGroup_.forEachFeatureAtPixel(
|
return this.replayGroup_.forEachFeatureAtPixel(
|
||||||
resolution, 0, coordinate, skippedFeatureUids,
|
coordinate, resolution, 0, skippedFeatureUids,
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {?} Callback result.
|
* @return {?} Callback result.
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ goog.inherits(ol.source.Source, ol.Observable);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {number} rotation Rotation.
|
* @param {number} rotation Rotation.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
|
||||||
* @param {Object.<string, boolean>} skippedFeatureUids Skipped feature uids.
|
* @param {Object.<string, boolean>} skippedFeatureUids Skipped feature uids.
|
||||||
* @param {function(ol.Feature): T} callback Feature callback.
|
* @param {function(ol.Feature): T} callback Feature callback.
|
||||||
* @return {T|undefined} Callback result.
|
* @return {T|undefined} Callback result.
|
||||||
|
|||||||
Reference in New Issue
Block a user