Module type for ol/Feature
This commit is contained in:
@@ -12,7 +12,7 @@ import {transform2D} from '../geom/flat/transform.js';
|
||||
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
||||
|
||||
/**
|
||||
* Lightweight, read-only, {@link ol.Feature} and {@link module:ol/geom/Geometry~Geometry} like
|
||||
* Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like
|
||||
* structure, optimized for vector tile rendering and styling. Geometry access
|
||||
* through the API is limited to getting the type and extent of the geometry.
|
||||
*
|
||||
@@ -205,7 +205,7 @@ RenderFeature.prototype.getFlatCoordinates =
|
||||
|
||||
|
||||
/**
|
||||
* For API compatibility with {@link ol.Feature}, this method is useful when
|
||||
* For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when
|
||||
* determining the geometry type in style function (see {@link #getType}).
|
||||
* @return {ol.render.Feature} Feature.
|
||||
* @api
|
||||
|
||||
@@ -17,7 +17,7 @@ const VectorContext = function() {
|
||||
* Render a geometry with a custom renderer.
|
||||
*
|
||||
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {Function} renderer Renderer.
|
||||
*/
|
||||
VectorContext.prototype.drawCustom = function(geometry, feature, renderer) {};
|
||||
@@ -41,13 +41,13 @@ VectorContext.prototype.setStyle = function(style) {};
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Circle~Circle} circleGeometry Circle geometry.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawCircle = function(circleGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {ol.style.Style} style Style.
|
||||
*/
|
||||
VectorContext.prototype.drawFeature = function(feature, style) {};
|
||||
@@ -56,7 +56,7 @@ VectorContext.prototype.drawFeature = function(feature, style) {};
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometryCollectionGeometry Geometry
|
||||
* collection.
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawGeometryCollection = function(geometryCollectionGeometry, feature) {};
|
||||
|
||||
@@ -64,7 +64,7 @@ VectorContext.prototype.drawGeometryCollection = function(geometryCollectionGeom
|
||||
/**
|
||||
* @param {module:ol/geom/LineString~LineString|ol.render.Feature} lineStringGeometry Line
|
||||
* string geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawLineString = function(lineStringGeometry, feature) {};
|
||||
|
||||
@@ -72,7 +72,7 @@ VectorContext.prototype.drawLineString = function(lineStringGeometry, feature) {
|
||||
/**
|
||||
* @param {module:ol/geom/MultiLineString~MultiLineString|ol.render.Feature} multiLineStringGeometry
|
||||
* MultiLineString geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawMultiLineString = function(multiLineStringGeometry, feature) {};
|
||||
|
||||
@@ -80,21 +80,21 @@ VectorContext.prototype.drawMultiLineString = function(multiLineStringGeometry,
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPoint~MultiPoint|ol.render.Feature} multiPointGeometry MultiPoint
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawMultiPoint = function(multiPointGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPolygon~MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Point~Point|ol.render.Feature} pointGeometry Point geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawPoint = function(pointGeometry, feature) {};
|
||||
|
||||
@@ -102,14 +102,14 @@ VectorContext.prototype.drawPoint = function(pointGeometry, feature) {};
|
||||
/**
|
||||
* @param {module:ol/geom/Polygon~Polygon|ol.render.Feature} polygonGeometry Polygon
|
||||
* geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawPolygon = function(polygonGeometry, feature) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
VectorContext.prototype.drawText = function(geometry, feature) {};
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ CanvasImmediateRenderer.prototype.drawGeometry = function(geometry) {
|
||||
* this method is called. If you need `zIndex` support, you should be using an
|
||||
* {@link ol.layer.Vector} instead.
|
||||
*
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature} feature Feature.
|
||||
* @param {ol.style.Style} style Style.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -449,7 +449,7 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
||||
/**
|
||||
* @protected
|
||||
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.beginGeometry = function(geometry, feature) {
|
||||
this.beginGeometryInstruction1_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0];
|
||||
@@ -496,7 +496,7 @@ CanvasReplay.prototype.setStrokeStyle_ = function(context, instruction) {
|
||||
|
||||
/**
|
||||
* @param {ol.DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.renderDeclutter_ = function(declutterGroup, feature) {
|
||||
if (declutterGroup && declutterGroup.length > 5) {
|
||||
@@ -538,7 +538,7 @@ CanvasReplay.prototype.renderDeclutter_ = function(declutterGroup, feature) {
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array.<*>} instructions Instructions array.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined}
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined}
|
||||
* featureCallback Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
@@ -584,14 +584,14 @@ CanvasReplay.prototype.replay_ = function(
|
||||
// When the batch size gets too big, performance decreases. 200 is a good
|
||||
// balance between batch size and number of fill/stroke instructions.
|
||||
const batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;
|
||||
let /** @type {ol.Feature|ol.render.Feature} */ feature;
|
||||
let /** @type {module:ol/Feature~Feature|ol.render.Feature} */ feature;
|
||||
let x, y;
|
||||
while (i < ii) {
|
||||
const instruction = instructions[i];
|
||||
const type = /** @type {ol.render.canvas.Instruction} */ (instruction[0]);
|
||||
switch (type) {
|
||||
case CanvasInstruction.BEGIN_GEOMETRY:
|
||||
feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]);
|
||||
feature = /** @type {module:ol/Feature~Feature|ol.render.Feature} */ (instruction[1]);
|
||||
if ((skipFeatures &&
|
||||
skippedFeaturesHash[getUid(feature).toString()]) ||
|
||||
!feature.getGeometry()) {
|
||||
@@ -760,7 +760,7 @@ CanvasReplay.prototype.replay_ = function(
|
||||
break;
|
||||
case CanvasInstruction.END_GEOMETRY:
|
||||
if (featureCallback !== undefined) {
|
||||
feature = /** @type {ol.Feature|ol.render.Feature} */ (instruction[1]);
|
||||
feature = /** @type {module:ol/Feature~Feature|ol.render.Feature} */ (instruction[1]);
|
||||
const result = featureCallback(feature);
|
||||
if (result) {
|
||||
return result;
|
||||
@@ -870,7 +870,7 @@ CanvasReplay.prototype.replay = function(
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T=} opt_featureCallback
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T=} opt_featureCallback
|
||||
* Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
@@ -1054,7 +1054,7 @@ CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
*/
|
||||
CanvasReplay.prototype.endGeometry = function(geometry, feature) {
|
||||
this.beginGeometryInstruction1_[2] = this.instructions.length;
|
||||
|
||||
@@ -288,7 +288,7 @@ CanvasReplayGroup.prototype.finish = function() {
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T} callback Feature
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T} callback Feature
|
||||
* callback.
|
||||
* @param {Object.<string, ol.DeclutterGroup>} declutterReplays Declutter
|
||||
* replays.
|
||||
@@ -335,7 +335,7 @@ CanvasReplayGroup.prototype.forEachFeatureAtCoordinate = function(
|
||||
let replayType;
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function featureCallback(feature) {
|
||||
|
||||
@@ -396,7 +396,7 @@ WebGLLineStringReplay.prototype.drawPolygonCoordinates = function(
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @param {number=} opt_index Index count.
|
||||
*/
|
||||
WebGLLineStringReplay.prototype.setPolygonStyle = function(feature, opt_index) {
|
||||
|
||||
@@ -95,7 +95,7 @@ const WebGLReplay = function(tolerance, maxExtent) {
|
||||
/**
|
||||
* Start index per feature (the feature).
|
||||
* @protected
|
||||
* @type {Array.<ol.Feature|ol.render.Feature>}
|
||||
* @type {Array.<module:ol/Feature~Feature|ol.render.Feature>}
|
||||
*/
|
||||
this.startIndicesFeature = [];
|
||||
|
||||
@@ -184,7 +184,7 @@ WebGLReplay.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hi
|
||||
* @param {ol.webgl.Context} context Context.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* this extent are checked.
|
||||
* @return {T|undefined} Callback result.
|
||||
@@ -199,7 +199,7 @@ WebGLReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, ski
|
||||
* @param {ol.webgl.Context} context Context.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* this extent are checked.
|
||||
@@ -226,7 +226,7 @@ WebGLReplay.prototype.drawHitDetectionReplay = function(gl, context, skippedFeat
|
||||
* @param {ol.webgl.Context} context Context.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -254,7 +254,7 @@ WebGLReplay.prototype.drawHitDetectionReplayAll = function(gl, context, skippedF
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* this extent are checked.
|
||||
|
||||
@@ -195,7 +195,7 @@ WebGLReplayGroup.prototype.replay = function(context,
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* this extent are checked.
|
||||
@@ -241,7 +241,7 @@ WebGLReplayGroup.prototype.replayHitDetection_ = function(context,
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((ol.Feature|ol.render.Feature)): T|undefined} callback Feature callback.
|
||||
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} callback Feature callback.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -268,7 +268,7 @@ WebGLReplayGroup.prototype.forEachFeatureAtCoordinate = function(
|
||||
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
|
||||
pixelRatio, opacity, skippedFeaturesHash,
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -309,7 +309,7 @@ WebGLReplayGroup.prototype.hasFeatureAtCoordinate = function(
|
||||
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
|
||||
pixelRatio, opacity, skippedFeaturesHash,
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {module:ol/Feature~Feature|ol.render.Feature} feature Feature.
|
||||
* @return {boolean} Is there a feature?
|
||||
*/
|
||||
function(feature) {
|
||||
|
||||
Reference in New Issue
Block a user