Hide Table of Contents
Object: esri/plugins/spatialIndex

require(["esri/plugins/spatialIndex"], function(spatialIndex) { /* code goes here */ });


(Added at v3.9)
A static utility module that adds or removes a SpatialIndex instance on a Map or FeatureLayer. Can be included in those classes as a constructor option or through the addPlugin method on those classes.


Search for samples that use this class.


NameReturn typeSummary
add(target, options?)NoneAdds an index property to the target instance.
remove()NoneRemoves the index plugin.
Method Details

add(target, options?)

Adds an index property to the target instance.
<Map | FeatureLayer> target Required The map or feature layer to which the index is connected.
<Object> options Optional See the object specifications table below for the structure of the index options object.
Object Specifications:
<Boolean> drawFeatures Optional Whether the processor allow the feature layer to draw its features. Default is true.
<String> indexType Optional The indexing system to use. One of "rtree", "kdtree", "quadtree". "kdtree" is only used for points. Default is "rtree".
<Boolean> passFeatures Optional Whether the processor pass the features through without modification or delay to the FeatureLayer. Default is true.
<SpatialIndex> spatialIndex Required A SpatialIndex processing instance to use rather than creating a new one.


Removes the index plugin.