Documentation and linting

This commit is contained in:
simonseyock
2016-11-25 10:07:13 +01:00
parent eede027417
commit f6ee11bb68
4 changed files with 13 additions and 10 deletions
+7 -7
View File
@@ -8,21 +8,21 @@ If you are using the layer filter of one of these methods, please note that you
Old syntax: 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: New syntax:
``` ```
map.forEachFeatureAtPixel(pixel, callback, callback_this, { map.forEachFeatureAtPixel(pixel, callback, callbackThis, {
layerFilter: layerFilter_function, layerFilter: layerFilterFn,
layerFilterThis: layerFilter_this layerFilterThis: layerFilterThis
}); });
map.hasFeatureAtPixel(pixel, { map.hasFeatureAtPixel(pixel, {
layerFilter: layerFilter_function, layerFilter: layerFilterFn,
layerFilterThis: layerFilter_this layerFilterThis: layerFilterThis
}); });
``` ```
+2 -2
View File
@@ -303,8 +303,8 @@ olx.MapOptions.prototype.view;
/** /**
* Object literal with options for the forEachFeatureAtPixel and * Object literal with options for the {@link ol.Map#forEachFeatureAtPixel} and
* hasFeatureAtPixel methods. * {@link ol.Map#hasFeatureAtPixel} methods.
* @typedef {{layerFilter: ((function(ol.layer.Layer): boolean)|undefined), * @typedef {{layerFilter: ((function(ol.layer.Layer): boolean)|undefined),
* layerFilterThis: (Object|undefined), * layerFilterThis: (Object|undefined),
* hitTolerance: (number|undefined)}} * hitTolerance: (number|undefined)}}
+1 -1
View File
@@ -574,7 +574,7 @@ ol.Map.prototype.disposeInternal = function() {
* @template S,T * @template S,T
* @api stable * @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_) { if (!this.frameState_) {
return; return;
} }
+3
View File
@@ -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.<number, Array.<Array.<(boolean|undefined)>>>} * @type {Object.<number, Array.<Array.<(boolean|undefined)>>>}
* @private * @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 * This methods creates a circle inside a fitting array. Points inside the
* circle are marked by true, points on the outside are undefined. * circle are marked by true, points on the outside are undefined.
* It uses the midpoint circle algorithm. * It uses the midpoint circle algorithm.
* A cache is used to increase performance.
* @param {number} radius Radius. * @param {number} radius Radius.
* @returns {Array.<Array.<(boolean|undefined)>>} An array with marked circle points. * @returns {Array.<Array.<(boolean|undefined)>>} An array with marked circle points.
* @private * @private