diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index a534c653af..52150aea99 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -8,21 +8,21 @@ If you are using the layer filter of one of these methods, please note that you Old syntax: ``` - map.forEachFeatureAtPixel(pixel, callback, callback_this, layerFilter_function, layerFilter_this); + map.forEachFeatureAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis); - map.hasFeatureAtPixel(pixel, layerFilter_function, layerFilter_this); + map.hasFeatureAtPixel(pixel, layerFilterFn, layerFilterThis); ``` New syntax: ``` - map.forEachFeatureAtPixel(pixel, callback, callback_this, { - layerFilter: layerFilter_function, - layerFilterThis: layerFilter_this + map.forEachFeatureAtPixel(pixel, callback, callbackThis, { + layerFilter: layerFilterFn, + layerFilterThis: layerFilterThis }); map.hasFeatureAtPixel(pixel, { - layerFilter: layerFilter_function, - layerFilterThis: layerFilter_this + layerFilter: layerFilterFn, + layerFilterThis: layerFilterThis }); ``` diff --git a/externs/olx.js b/externs/olx.js index 72ea000573..8056fa3203 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -303,8 +303,8 @@ olx.MapOptions.prototype.view; /** - * Object literal with options for the forEachFeatureAtPixel and - * hasFeatureAtPixel methods. + * Object literal with options for the {@link ol.Map#forEachFeatureAtPixel} and + * {@link ol.Map#hasFeatureAtPixel} methods. * @typedef {{layerFilter: ((function(ol.layer.Layer): boolean)|undefined), * layerFilterThis: (Object|undefined), * hitTolerance: (number|undefined)}} diff --git a/src/ol/map.js b/src/ol/map.js index 4bf8ec9dc7..d64cb9e12d 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -574,7 +574,7 @@ ol.Map.prototype.disposeInternal = function() { * @template S,T * @api stable */ -ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_this,opt_options) { +ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_this, opt_options) { if (!this.frameState_) { return; } diff --git a/src/ol/render/canvas/replaygroup.js b/src/ol/render/canvas/replaygroup.js index 3614a54244..b928d8293f 100644 --- a/src/ol/render/canvas/replaygroup.js +++ b/src/ol/render/canvas/replaygroup.js @@ -76,6 +76,8 @@ ol.inherits(ol.render.canvas.ReplayGroup, ol.render.ReplayGroup); /** + * This cache is used for storing calculated pixel circles for increasing performance. + * It is a static property to allow each Replaygroup to access it. * @type {Object.>>} * @private */ @@ -111,6 +113,7 @@ ol.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_ = function(array, x, y) * This methods creates a circle inside a fitting array. Points inside the * circle are marked by true, points on the outside are undefined. * It uses the midpoint circle algorithm. + * A cache is used to increase performance. * @param {number} radius Radius. * @returns {Array.>} An array with marked circle points. * @private