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

filterByNearest

Creates an filter that filters features based on their proximity to a point (latitude, longitude).

Parameters

Name Required Description
point Yes The GeoJSON Point from which to test proximity. latitude value of the coordinate.
options No An object for the configuration of the filterByNearest filter. The possible options are shown in the section below.

Options

Name Default Description
take 1 The number of features to return.
includeDistance false If this is true, the distance to each feature is added as a property to the feature

Example


var qry = new Mapzania.QueryEngine();

qry.usingLayerSource("COUNTRIES")
  .filterByNearest({type:"Point", coordinates:[10.2, -12.5]}, {take:3})
  .apply()
  .then(function(data){
        console.log(data);
   });