Arcgis Engine (ae) Detailed Interface (7): map (map) operation

            Map = IMap null ;
             // with the same level of activeView map objects, they are "map" of the object, map manage map content, activeView display content management 
            IActiveView activeView = map AS IActiveView; 

            // Get the current map display range 
            IEnvelope extent = activeView.Extent;
             // set the current map display range, which is equivalent to using code to achieve a zoom range 
            activeView.Extent = extent; 

            // get the full extent of the map
             // map View full chart functions, his range is so get 
            IEnvelope fullExtent = activeView.FullExtent; 

            // obtain the map scale, while at the same scale set 
            Double mapScale = map.MapScale; 

            // get and set the map units
            Unit = esriUnits map.MapUnits;
             // get and set the map display units 
            esriUnits Unit2 = map.DistanceUnits; 

            // refresh the map 
            activeView.Refresh (); 

            // screen length (in pixels) turn map the actual length 
            Double mapLength = MapHelper .PixelsToMapUnits (activeView, . 5 ); 

            // Get Map all the FeatureLayer 
            List <IFeatureLayer> lstFeatureLayer = MapHelper.GetAllFeatureLayerInMap (Map); 

            IF ( . 1 == 2 ) 
            { 
                // Get the name of the layer by the real table in the Map, for sde table name with a user name can not
                FeatureLayer = MapHelper.GetFeatureLayerByDatasetName IFeatureLayer (Map, " roadLine " ); 


            } 

            the foreach (IFeatureLayer FeatureLayer in lstFeatureLayer) 
            { 
                // layers instructions 

                // IFeatureLayer representative of vector layers, while layers ILayer representatives, but also all types of interfaces layers achieved ILayer, so as to be IFeatureLayer the ILayer 
                the ILayer layer = FeatureLayer as the ILayer; 

                // get and set status visible layer (layer tree is in the interface layer left CheckBox) 
                BOOL visible = layer.Visible;
                 // Gets or sets the layer name 
                String name = layer.Name; 

                //FeatureClass get through the layers is one way to get featureClass of. Another way is to get through Workspace
                 // Note IFeatureLayer and IFeatureClass are two things, although usually be called "layer." IFeatureClass refers to a physical table, Table IFeatureLayer refers to physically loading layer formed on a map, the former refers to the more data, the latter only in a map display settings, such as styles, such as tagging 
                IFeatureClass FeatureClass = featureLayer.FeatureClass;                 
            }

 

Guess you like

Origin www.cnblogs.com/cannel/p/11074339.html