JS API
Map Object
QueryEngine Object
Layer Object
Feature Object
Query Object
GeoJson Function Library (Experimental)

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);
   });