Example #1
0
        public override void Reload()
        {
            DataFrames.Clear();
            DefaultDataFrame = null;

            _serviceInfo = (ServiceInfo)Send(new GetServiceInfo());

            if (IsArcMap)
            {
                foreach (DataFrameInfo dataFrameInfo in _serviceInfo.DataFrameInfos)
                {
                    ArcImsDataFrame dataFrame = new ArcImsDataFrame(this, dataFrameInfo);
                    DataFrames.Add(dataFrame);

                    if (dataFrame.IsDefault)
                    {
                        DefaultDataFrame = dataFrame;
                    }
                }

                if (DefaultDataFrame == null && DataFrames.Count > 0)
                {
                    DefaultDataFrame = DataFrames[0];
                }
            }
            else
            {
                ArcImsDataFrame dataFrame = new ArcImsDataFrame(this);
                DataFrames.Add(dataFrame);
                DefaultDataFrame = dataFrame;
            }
        }
Example #2
0
        public ArcImsMap(ArcImsDataFrame dataFrame, int width, int height, Envelope extent)
        {
            _service = dataFrame.Service as ArcImsService;

            DataFrame = dataFrame;
            Width     = width;
            Height    = height;
            Extent    = extent;
        }
Example #3
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;
                }
            }
        }