Dynamically limiting the extent of an ArcGISDynamicMapServerLayer

479
0
04-13-2017 12:52 PM
SteveBurdette1
New Contributor II

We have a few ArcGISDynamicMapServerLayers that are querying several hundred thousand lines.  We can dynamically limit the results that the layer is querying by using the layerDefinitions, like this:

var layerDynamic = new ArcGISDynamicMapServiceLayer(myUrl);

var layerDefinitions = [];

layerDefinitions[0] = "City = 'MyCity'";

layerDynamic.setLayerDefinitions(layerDefinitions);

This works great and really improves performance.  However, if I want to limit the layer by a given Extent, can I do that?  For example, if a user zooms to a particular county, then I want to limit the ArcGISDynamicMapServiceLayer by that county's polygon shape extent.  

0 Kudos
0 Replies