Beispiel #1
0
        internal void ReloadLegend()
        {
            if (Type == CommonLayerType.Feature)
            {
                Legend = null;

                if (_layerInfo.Toc != null)
                {
                    Legend = new ArcImsLegend(_layerInfo.Toc);
                }
            }
        }
Beispiel #2
0
        public ArcImsLayer(ArcImsDataFrame dataFrame, LayerInfo layerInfo)
        {
            _service   = dataFrame.Service as ArcImsService;
            _layerInfo = layerInfo;

            DataFrame        = dataFrame;
            DefaultVisible   = layerInfo.Visible;
            ID               = layerInfo.ID;
            MinimumPixelSize = ConvertIfDouble(layerInfo.MinScale, MinimumPixelSize);
            MaximumPixelSize = ConvertIfDouble(layerInfo.MaxScale, MaximumPixelSize);
            Name             = layerInfo.Name;

            if (layerInfo.Type == LayerType.FeatureClass)
            {
                Selectable = true;

                switch (layerInfo.FClass.Type)
                {
                case FClassType.Line: FeatureType = OgcGeometryType.MultiLineString; break;

                case FClassType.Polygon: FeatureType = OgcGeometryType.MultiPolygon; break;
                }

                Fields = new List <CommonField>();

                foreach (Field axlField in layerInfo.FClass.Fields)
                {
                    ArcImsField field = new ArcImsField(layerInfo.FClass, axlField);
                    Fields.Add(field);

                    if (field.Type == CommonFieldType.ID)
                    {
                        FeatureIDField = field;
                    }
                    else if (field.Type == CommonFieldType.Geometry)
                    {
                        GeometryField = field;
                    }
                }

                if (layerInfo.Toc != null)
                {
                    Legend = new ArcImsLegend(layerInfo.Toc);
                }
            }
            else
            {
                switch (layerInfo.ArcMapType)
                {
                case ArcMapType.Group: Type = CommonLayerType.Group; break;

                case ArcMapType.Annotation: Type = CommonLayerType.Annotation; break;

                default:
                    if (layerInfo.Type == LayerType.Image)
                    {
                        Type = layerInfo.Toc != null && layerInfo.Toc.Count > 0 ? CommonLayerType.Image : CommonLayerType.Annotation;
                    }
                    break;
                }
            }
        }