靜態unAdd a single feature to the source. If you want to add a batch of features at once, call source.addFeatures() instead.
Iterate through all features on the source, calling the provided callback with each one. If the callback returns any "truthy" value, iteration will stop and the function will return the same value.
The return value from the last call to the callback.
Iterate through all features whose bounding box intersects the provided extent (note that the feature's geometry may not intersect the extent), calling the callback with each feature. If the callback returns a "truthy" value, iteration will stop and the function will return the same value.
If you are interested in features whose geometry intersects an extent, call the * source.forEachFeatureIntersectingExtent() method instead.
When useSpatialIndex is set to false, this method will loop through all
features, equivalent to ol.source.Vector#forEachFeature.
The return value from the last call to the callback.
Iterate through all features whose geometry intersects the provided extent, calling the callback with each feature. If the callback returns a "truthy" value, iteration will stop and the function will return the same value.
If you only want to test for bounding box intersection, call the * source.forEachFeatureInExtent() method instead.
The return value from the last call to the callback.
Get the features collection associated with this source. Will be null
unless the source was configured with useSpatialIndex set to false, or
with an ol.Collection as features.
The collection of features.
Get all features whose geometry intersects the provided coordinate.
Coordinate.
Features.
Get all features in the provided extent. Note that this returns all features whose bounding boxes intersect the given extent (so it may include features whose geometries do not intersect the extent).
This method is not available when the source is configured with
useSpatialIndex set to false.
Extent.
Features.
Get the closest feature to the provided coordinate.
This method is not available when the source is configured with
useSpatialIndex set to false.
Coordinate.
可選opt_filter: (feature: ol.Feature) => booleanFeature filter function. The filter function will receive one argument, the feature and it should return a boolean value. By default, no filtering is made.
Closest feature.
Get the extent of the features currently in the source.
This method is not available when the source is configured with
useSpatialIndex set to false.
Extent.
Get a feature by its identifier (the value returned by feature.getId()).
Note that the index treats string and numeric identifiers as the same. So
source.getFeatureById(2) will return a feature with id '2' or 2.
Feature identifier.
The feature (or null if not found).
Remove a single feature from the source. If you want to remove all features at once, use the source.clear() method instead.
Set the attributions of the source.
Attributions.
Can be passed as string, Array<string>, {@link ol.Attribution},
Array<{@link ol.Attribution}> or undefined.
Listen for a certain type of event.
The event type or array of event types.
The listener function.
可選opt_this: ObjectThe object to use as this in listener.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
Listen once for a certain type of event.
The event type or array of event types.
The listener function.
可選opt_this: ObjectThe object to use as this in listener.
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
函數Removes an event listener using the key returned by on() or once().
Note that using the ol.Observable.unByKey static function is to
be preferred.
Constructor options.
Classdesc
Layer source to cluster vector data. Works out of the box with point geometries. For other geometry types, or if not all geometries should be considered for clustering, a custom
geometryFunctioncan be defined.參數: options
Constructor options.
Api