AnsweredAssumed Answered

Zoom to layer defined by CreateSelectionLayer

Question asked by GlennNead on May 8, 2013
Latest reply on May 10, 2013 by GlennNead

I have several layers that have been created from a non-displayed "master layer" using IFeatureLayerDefinition2.CreateSelectionLayer to cut down on the number of feature classes stored in a file GeoDatabase (gdb).

This has worked fine adding the layers to the table of contents and only displaying the desired features.  However, when using the sample code to Zoom to a Layer (Displaying a TOCControl Context Menu sample), the extent sent via "ref layer" is the full extent of all features that were in the feature class up to that point.  For example Layer1 of Rectangle 1 zooms to just Rectangle 1.  Layer 3 created by querying for Rectangle 3 zooms to rectangles 1, 2 and 3.

How do I zoom only into the feature(s) that were part of the original query in the CreateSelectionLayer?


     -- Glenn