JS API
- Parameters
- Options
- Example
- Methods
- fitToBoundingBox
- getBoundingBox
- getInitialBoundingBox
- getLayers
- getMouseMode
- off
- on
- once
- refresh
- reset
- setMouseMode
- usingLayer
- usingNewLayer
- Events
- Parameters
- Example
- Methods
- addFeature
- addFeatureCollection
- bringForwards
- bufferGeometry
- changeProperties
- clearFilters
- clearFeatures
- clearStyle
- clipByFeatureCollection
- convertToCentroids
- filterByBoundingBox
- filterByFeatureCollection
- filterByNearest
- filterByText
- getFeatureCollection
- hide
- sendBackwards
- show
- style
- update
- usingFeature
filterByFeatureCollection
Creates an filter that filters features based on whether or not they are contained by a GeoJSON FeatureCollection.
Parameters
Name | Required | Description |
---|---|---|
features | Yes | A GeoJSON FeatureCollection. |
options | No | An object for the configuration of the filterByFeatureCollection filter. The possible options are shown in the section below. |
Options
Name | Default | Description |
---|---|---|
operator | 'intersects' | Defines the spatial operator that will be applied in the filter. Possible values are: - 'intersects' - 'contains' - 'crosses' |
Example
var featureCollection = {
type:"FeatureCollection",
features: [
{
type: "Feature",
geometry: {
coordinates: [
[
[4.88922, 52.37072],
[4.89526, 52.37114],
[4.89209, 52.36931],
[4.88925, 52.37072]
]
],
type: "Polygon"
}
}
]
};
var qry = new Mapzania.QueryEngine();
qry.usingLayerSource("COUNTRIES")
.filterByFeatureCollection(featureCollection);
.apply()
.then(function(data){
console.log(data);
});