Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: Processor

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

Description

(Added at v3.9)
The base processor class provides the generic api for processors and provides an extension point from which developers can create and extend additional processors.

Samples

Search for samples that use this class.

Subclasses

Constructors

NameSummary
new Processor(options?)Creates a processor.

Properties

NameTypeSummary
drawFeaturesBooleanAllow the feature layer to draw the features.
fetchWithWorkerBooleanShould features be fetched through the Worker.
layersFeatureLayer[]Layer(s) connected to the processor.
passFeaturesBooleanPass features back to layer without delay before processing.
requireWorkerSupportBooleanRequire support for Worker in order to use this processor.

Methods

NameReturn typeSummary
addLayer(layer)NoneAdd layer to processor.
removeLayer(layer)NoneRemove layer from processor.
setMap(map)NoneSynchronize the layers the processor handles with the map's GraphicsLayer and GraphicsLayer subclasses (FeatureLayer etc).
start()NoneStart the processor.
stop()NoneStop the processor.
unsetMap()NoneUnset the map and detach processor from all layers.

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

NameEvent ObjectSummary
startFires when the processor is started.
stopFires when the processor is stopped.
Constructor Details

new Processor(options?)

Creates a processor.
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> fetchWithWorker Optional Whether the processor do the layer's I/O via a worker. Default is false.
<FeatureLayer[]> layers Optional A FeatureLayer or array of FeatureLayers to attach the processor to. Ignore 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

<Boolean> drawFeatures

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

<Boolean> fetchWithWorker

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.

<Boolean> passFeatures

Pass features back to layer without delay before processing.
Known values: true | false
Default value: true

<Boolean> requireWorkerSupport

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

addLayer(layer)

Add layer to processor.
Parameters:
<FeatureLayer> layer Required FeatureLayer to be added.

removeLayer(layer)

Remove layer from processor.
Parameters:
<FeatureLayer> layer Required FeatureLayer to be removed.

setMap(map)

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()

Start the processor. Normally occurs automatically. Fires the start event.

stop()

Stop the processor. Fires the stop event.

unsetMap()

Unset the map and detach processor from all layers.
Event Details
[ On Style Events | Connect Style Event ]

start

Fires when the processor is started.

stop

Fires when the processor is stopped.