selected features symbol cut-off on border of the screen

1933
2
11-03-2014 06:51 AM
BhavinSanghani
Occasional Contributor II

I select features on feature layers as per the following example in my application.

 

Select with Feature Layer | ArcGIS API for JavaScript

 

Once the features are selected, I use following code to set an extent of the map.

 

gisMap.setExtent(graphicsUtils.graphicsExtent(selectedFeatures));

 

The problem is - when the features are highlighted using symbol/text, they slightly cut-off on the screen (see Capture1.jpg attached). If I zoom-in then it appears properly (see Capture2.jpg attached). How can I fix this issue so, selected features with symbols appear properly on the screen without cut-off? I wonder if I need to manipulate the extent manually by some value e.g. xmin-1000, ymin-100 etc. Not sure if this is correct approach to do. Any suggestions?

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

If your map contains a tiled layer, there's an optional parameter you can use in setExtent to make sure the new extent is fully contained in the map view.

gisMap.setExtent(graphicsUtils.graphicsExtent(selectedFeatures), true);

0 Kudos
BhavinSanghani
Occasional Contributor II

No, I am not using tile layer. I am using ArcGISDynamicMapServiceLayer. Is there any way to achieve it using dynamic layer?

0 Kudos