Move olx.source.ClusterOptions to ol/source/ClusterOptions
This commit is contained in:
@@ -49,94 +49,6 @@ olx.render.State.prototype.resolution;
|
|||||||
olx.render.State.prototype.rotation;
|
olx.render.State.prototype.rotation;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
|
||||||
* distance: (number|undefined),
|
|
||||||
* extent: (ol.Extent|undefined),
|
|
||||||
* format: (ol.format.Feature|undefined),
|
|
||||||
* geometryFunction: (undefined|function(module:ol/Feature~Feature):module:ol/geom/Point~Point),
|
|
||||||
* projection: ol.ProjectionLike,
|
|
||||||
* source: ol.source.Vector,
|
|
||||||
* wrapX: (boolean|undefined)}}
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attributions.
|
|
||||||
* @type {ol.AttributionLike|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.attributions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimum distance in pixels between clusters. Default is `20`.
|
|
||||||
* @type {number|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.distance;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extent.
|
|
||||||
* @type {ol.Extent|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.extent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function that takes an {@link module:ol/Feature~Feature} as argument and returns an
|
|
||||||
* {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
|
|
||||||
* feature should not be considered for clustering, the function should return
|
|
||||||
* `null`. The default, which works when the underyling source contains point
|
|
||||||
* features only, is
|
|
||||||
* ```js
|
|
||||||
* function(feature) {
|
|
||||||
* return feature.getGeometry();
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
|
|
||||||
* calculation point for polygons.
|
|
||||||
* @type {undefined|function(module:ol/Feature~Feature):module:ol/geom/Point~Point}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.geometryFunction;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format.
|
|
||||||
* @type {ol.format.Feature|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.format;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Projection.
|
|
||||||
* @type {ol.ProjectionLike}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.projection;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Source.
|
|
||||||
* @type {ol.source.Vector}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.source;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WrapX. Default is true
|
|
||||||
* @type {boolean|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.source.ClusterOptions.prototype.wrapX;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{preemptive: (boolean|undefined),
|
* @typedef {{preemptive: (boolean|undefined),
|
||||||
* jsonp: (boolean|undefined),
|
* jsonp: (boolean|undefined),
|
||||||
|
|||||||
@@ -12,6 +12,31 @@ import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js';
|
|||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import VectorSource from '../source/Vector.js';
|
import VectorSource from '../source/Vector.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} Options
|
||||||
|
* @property {ol.AttributionLike} [attributions] Attributions.
|
||||||
|
* @property {number} [distance=20] Minimum distance in pixels between clusters.
|
||||||
|
* @property {ol.Extent} [extent] Extent.
|
||||||
|
* @property {ol.format.Feature} [format] Format.
|
||||||
|
* @property {function(module:ol/Feature~Feature):module:ol/geom/Point~Point} [geometryFunction]
|
||||||
|
* Function that takes an {@link module:ol/Feature~Feature} as argument and returns an
|
||||||
|
* {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
|
||||||
|
* feature should not be considered for clustering, the function should return
|
||||||
|
* `null`. The default, which works when the underyling source contains point
|
||||||
|
* features only, is
|
||||||
|
* ```js
|
||||||
|
* function(feature) {
|
||||||
|
* return feature.getGeometry();
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
|
||||||
|
* calculation point for polygons.
|
||||||
|
* @property {ol.ProjectionLike} projection Projection.
|
||||||
|
* @property {ol.source.Vector} source Source.
|
||||||
|
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Layer source to cluster vector data. Works out of the box with point
|
* Layer source to cluster vector data. Works out of the box with point
|
||||||
@@ -19,7 +44,7 @@ import VectorSource from '../source/Vector.js';
|
|||||||
* considered for clustering, a custom `geometryFunction` can be defined.
|
* considered for clustering, a custom `geometryFunction` can be defined.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {olx.source.ClusterOptions} options Constructor options.
|
* @param {module:ol/source/Cluster~Options=} options Cluster options.
|
||||||
* @extends {ol.source.Vector}
|
* @extends {ol.source.Vector}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user