Module type for ol/Feature
This commit is contained in:
@@ -36,7 +36,7 @@ inherits(LayerRenderer, Observable);
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {function(this: S, (ol.Feature|ol.render.Feature), ol.layer.Layer): T}
|
||||
* @param {function(this: S, (module:ol/Feature~Feature|ol.render.Feature), ol.layer.Layer): T}
|
||||
* callback Feature callback.
|
||||
* @param {S} thisArg Value to use as `this` when executing `callback`.
|
||||
* @return {T|undefined} Callback result.
|
||||
|
||||
@@ -90,7 +90,7 @@ function expireIconCache(map, frameState) {
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {olx.FrameState} frameState FrameState.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {function(this: S, (ol.Feature|ol.render.Feature),
|
||||
* @param {function(this: S, (module:ol/Feature~Feature|ol.render.Feature),
|
||||
* ol.layer.Layer): T} callback Feature callback.
|
||||
* @param {S} thisArg Value to use as `this` when executing `callback`.
|
||||
* @param {function(this: U, ol.layer.Layer): boolean} layerFilter Layer filter
|
||||
@@ -108,7 +108,7 @@ MapRenderer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameSta
|
||||
const viewResolution = viewState.resolution;
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
|
||||
@@ -107,7 +107,7 @@ IntermediateCanvasRenderer.prototype.forEachFeatureAtCoordinate = function(coord
|
||||
return source.forEachFeatureAtCoordinate(
|
||||
coordinate, resolution, rotation, hitTolerance, skippedFeatureUids,
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
|
||||
@@ -58,7 +58,7 @@ const CanvasVectorLayerRenderer = function(vectorLayer) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {function(ol.Feature, ol.Feature): number|null}
|
||||
* @type {function(module:ol/Feature~Feature, module:ol/Feature~Feature): number|null}
|
||||
*/
|
||||
this.renderedRenderOrder_ = null;
|
||||
|
||||
@@ -257,7 +257,7 @@ CanvasVectorLayerRenderer.prototype.forEachFeatureAtCoordinate = function(coordi
|
||||
const features = {};
|
||||
const result = this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, {},
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -358,7 +358,7 @@ CanvasVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerSta
|
||||
pixelRatio, vectorSource.getOverlaps(), this.declutterTree_, vectorLayer.getRenderBuffer());
|
||||
vectorSource.loadFeatures(extent, resolution, projection);
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorLayer}
|
||||
*/
|
||||
const render = function(feature) {
|
||||
@@ -374,11 +374,11 @@ CanvasVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerSta
|
||||
}
|
||||
}.bind(this);
|
||||
if (vectorLayerRenderOrder) {
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
/** @type {Array.<module:ol/Feature~Feature>} */
|
||||
const features = [];
|
||||
vectorSource.forEachFeatureInExtent(extent,
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
function(feature) {
|
||||
features.push(feature);
|
||||
@@ -404,7 +404,7 @@ CanvasVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerSta
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {(ol.style.Style|Array.<ol.style.Style>)} styles The style or array of
|
||||
|
||||
@@ -197,7 +197,7 @@ CanvasVectorTileLayerRenderer.prototype.createReplayGroup_ = function(tile, fram
|
||||
const squaredTolerance = getSquaredRenderTolerance(resolution, pixelRatio);
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @this {ol.renderer.canvas.VectorTileLayer}
|
||||
*/
|
||||
const render = function(feature) {
|
||||
@@ -292,7 +292,7 @@ CanvasVectorTileLayerRenderer.prototype.forEachFeatureAtCoordinate = function(co
|
||||
replayGroup = sourceTile.getReplayGroup(layer, tile.tileCoord.toString());
|
||||
found = found || replayGroup.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, {},
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -446,7 +446,7 @@ CanvasVectorTileLayerRenderer.prototype.postCompose = function(context, frameSta
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {(ol.style.Style|Array.<ol.style.Style>)} styles The style or array of
|
||||
* styles.
|
||||
|
||||
+13
-13
@@ -33,8 +33,8 @@ const GEOMETRY_RENDERERS = {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature1 Feature 1.
|
||||
* @param {ol.Feature|ol.render.Feature} feature2 Feature 2.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature1 Feature 1.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature2 Feature 2.
|
||||
* @return {number} Order.
|
||||
*/
|
||||
export function defaultOrder(feature1, feature2) {
|
||||
@@ -67,7 +67,7 @@ export function getTolerance(resolution, pixelRatio) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
function renderCircleGeometry(replayGroup, geometry, style, feature) {
|
||||
const fillStyle = style.getFill();
|
||||
@@ -88,7 +88,7 @@ function renderCircleGeometry(replayGroup, geometry, style, feature) {
|
||||
|
||||
/**
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {function(this: T, ol.events.Event)} listener Listener function.
|
||||
@@ -120,7 +120,7 @@ export function renderFeature(replayGroup, feature, style, squaredTolerance, lis
|
||||
|
||||
/**
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
*/
|
||||
@@ -144,7 +144,7 @@ function renderFeatureInternal(replayGroup, feature, style, squaredTolerance) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderGeometry(replayGroup, geometry, style, feature) {
|
||||
if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
||||
@@ -163,7 +163,7 @@ function renderGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
function renderGeometryCollectionGeometry(replayGroup, geometry, style, feature) {
|
||||
const geometries = geometry.getGeometriesArray();
|
||||
@@ -180,7 +180,7 @@ function renderGeometryCollectionGeometry(replayGroup, geometry, style, feature)
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/LineString~LineString|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderLineStringGeometry(replayGroup, geometry, style, feature) {
|
||||
const strokeStyle = style.getStroke();
|
||||
@@ -202,7 +202,7 @@ function renderLineStringGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/MultiLineString~MultiLineString|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderMultiLineStringGeometry(replayGroup, geometry, style, feature) {
|
||||
const strokeStyle = style.getStroke();
|
||||
@@ -224,7 +224,7 @@ function renderMultiLineStringGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
function renderMultiPolygonGeometry(replayGroup, geometry, style, feature) {
|
||||
const fillStyle = style.getFill();
|
||||
@@ -247,7 +247,7 @@ function renderMultiPolygonGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Point~Point|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderPointGeometry(replayGroup, geometry, style, feature) {
|
||||
const imageStyle = style.getImage();
|
||||
@@ -272,7 +272,7 @@ function renderPointGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/MultiPoint~MultiPoint|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderMultiPointGeometry(replayGroup, geometry, style, feature) {
|
||||
const imageStyle = style.getImage();
|
||||
@@ -297,7 +297,7 @@ function renderMultiPointGeometry(replayGroup, geometry, style, feature) {
|
||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Polygon~Polygon|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
function renderPolygonGeometry(replayGroup, geometry, style, feature) {
|
||||
const fillStyle = style.getFill();
|
||||
|
||||
@@ -116,7 +116,7 @@ WebGLImageLayerRenderer.prototype.forEachFeatureAtCoordinate = function(coordina
|
||||
coordinate, resolution, rotation, hitTolerance, skippedFeatureUids,
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
|
||||
@@ -48,7 +48,7 @@ const WebGLVectorLayerRenderer = function(mapRenderer, vectorLayer) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {function(ol.Feature, ol.Feature): number|null}
|
||||
* @type {function(module:ol/Feature~Feature, module:ol/Feature~Feature): number|null}
|
||||
*/
|
||||
this.renderedRenderOrder_ = null;
|
||||
|
||||
@@ -150,7 +150,7 @@ WebGLVectorLayerRenderer.prototype.forEachFeatureAtCoordinate = function(coordin
|
||||
frameState.size, frameState.pixelRatio, layerState.opacity,
|
||||
{},
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -261,7 +261,7 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
||||
extent, vectorLayer.getRenderBuffer());
|
||||
vectorSource.loadFeatures(extent, resolution, projection);
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @this {ol.renderer.webgl.VectorLayer}
|
||||
*/
|
||||
const render = function(feature) {
|
||||
@@ -277,11 +277,11 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
||||
}
|
||||
};
|
||||
if (vectorLayerRenderOrder) {
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
/** @type {Array.<module:ol/Feature~Feature>} */
|
||||
const features = [];
|
||||
vectorSource.forEachFeatureInExtent(extent,
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
function(feature) {
|
||||
features.push(feature);
|
||||
@@ -304,7 +304,7 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {(ol.style.Style|Array.<ol.style.Style>)} styles The style or array of
|
||||
|
||||
Reference in New Issue
Block a user