dojo.require("esri.process.SpatialIndex")
Description
(Added at v3.9)
Builds and maintains a spatial index of feature geometry in one or more FeatureLayer.
Samples
Search for
samples that use this class.
Class hierarchy
esri/process.Processor
|_esri/process.SpatialIndex
Constructors
Properties
Methods
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Events
start | | Fires when the processor is started. |
stop | | Fires when the processor is stopped. |
Old Events
onStart() | Fires when the processor is started. |
onStop() | Fires when the processor is stopped. |
Constructor Details
Creates a SpatialIndex.
Parameters:
<Object > options |
Optional |
Configuration options for the processor. |
options
properties:
<Boolean > autostart |
Optional |
Start processing features immediately. Default is true . |
<Boolean > drawFeatures |
Optional |
Whether the processor allow the feature layer to draw its features. Default is true . |
<Boolean > fetchWithWorkers |
Optional |
Whether the processor do the layer's I/O via a worker. Default is false . |
<Object > indexOptions |
Optional |
Index system specific options. |
<String > indexType |
Optional |
The indexing system to use. Either "rtree" or "kdtree" . "kdtree" is only used for points. Default is "rtree" . |
<FeatureLayer[] > layers |
Optional |
A FeatureLayer or array of FeatureLayers to attach the processor to. Ignored if map is provided. |
<Map > map |
Optional |
Uses all FeatureLayers associated with the map in the processor. Remains in sync with the map's layers. Takes precedence over layer option. |
<Boolean > passFeatures |
Optional |
Whether the processor pass the features through without modification or delay to the FeatureLayer. Default is true . |
<Boolean > requireWorkerSupport |
Optional |
Whether the processor require Workers to function properly. Default is true . |
Property Details
Allow the feature layer to draw the features. This interacts with the passFeatures
option. If both are true
, then the layer will behave normally. If both are false
, then the layer won't receive the features until the processor is finished and then won't draw them. The other combinations will either cause the features to be passed immediately, but not drawn; or passed only after processing but then drawn as normal.
Known values: true | false
Default value: true
Should features be fetched through the Worker. In OnDemandMode
, it is almost always faster to fetch the features via the main thread and then allow the processor to pass them to the process worker.
Known values: true | false
Default value: false
Layer(s) connected to the processor.
Pass features back to layer without delay before processing.
Known values: true | false
Default value: true
Require support for Worker in order to use this processor. The default is true
. If this is the case and the client's browser does not support Workers then this process won't attach or start and the feature layer will be unaffected by this process. You should only modify this value to false
with very careful consideration. Use false with extreme caution. A value of false
could cause significant slow downs and even crashes on older browsers.
Known values: true | false
Default value: true
Method Details
Searches index for items which intersect the test object. This is a bounding box search.
Parameters:
<Point | Graphic | Extent | Number[] > test |
Required |
The point or area to intersect. |
<String > layerId |
Optional |
ID assigned to the layer. |
<Boolean > getRects |
Optional |
Whether to get the rectangle object with data in leaf , otherwise just get the stored data. |
Searches for the nearest point(s) to the passed point within the specified criteria.
Parameters:
<Object > criteria |
Required |
See the object specifications table below for the structure of the criteria object. |
<String > layerId |
Optional |
ID assigned to the layer. |
Object Specifications: <criteria
>
<Number > count |
Optional |
The maximum number of nearest points to return. |
<Number > distance |
Optional |
The maximum distance from the search point to return points. |
<Function > filter |
Optional |
A function which determines if the point should be included in the results. |
<Point | Number[] | Graphic > point |
Required |
(Required) The point to find the nearest neighbors. |
Remove layer from processor.
Synchronize the layers the processor handles with the map's GraphicsLayer and GraphicsLayer subclasses (FeatureLayer etc).
Parameters:
<Map > map |
Required |
The map instance to synchronize layers with. |
Start the processor. Normally occurs automatically. Fires the start
event.
Stop the processor. Fires the stop
event.
Unset the map and detach processor from all layers.
Event Details
[ On Style Events | Connect Style Event ]
Fires when the processor is started.
Fires when the processor is stopped.
Fires when the processor is started.
Fires when the processor is stopped.