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
clipByFeatureCollection
Creates an filter that clips features on the layer based on whether or not they are inside of a GeoJSON FeatureCollection.
Parameters
Name | Required | Description |
---|---|---|
featureCollection | Yes | A GeoJSON FeatureCollection. |
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"
}
}
]
};
map.usingLayer("COUNTRIES")
.clipByFeatureCollection(featureCollection)
.update();