示例#1
0
        public ArcImsMap(ArcImsDataFrame dataFrame, int width, int height, Envelope extent)
        {
            _service = dataFrame.Service as ArcImsService;

            DataFrame = dataFrame;
            Width     = width;
            Height    = height;
            Extent    = extent;
        }
示例#2
0
        public SwatchMaker(ArcImsService service, int swatchWidth, int swatchHeight)
        {
            _service = service;

            _map           = new ArcImsMap(_service, swatchWidth, swatchHeight, new Envelope(new Coordinate(0, 0), new Coordinate(swatchWidth, swatchHeight)));
            _map.ImageType = CommonImageType.Png;

            _width  = swatchWidth;
            _height = swatchHeight;
        }
示例#3
0
        public ArcImsDataFrame(ArcImsService service)
        {
            Service   = service;
            Name      = "Layers";
            IsDefault = true;

            foreach (LayerInfo layerInfo in service.ServiceInfo.LayerInfos)
            {
                Layers.Add(new ArcImsLayer(this, layerInfo));
            }

            CreateLayerHierarchy();
        }
示例#4
0
        public ArcImsDataFrame(ArcImsService service, DataFrameInfo dataFrameInfo)
        {
            _dataFrameInfo = dataFrameInfo;

            Service   = service;
            Dpi       = service.ServiceInfo.Environment.Screen.Dpi;
            Name      = dataFrameInfo.Name;
            IsDefault = dataFrameInfo.Default;

            foreach (LayerInfo layerInfo in dataFrameInfo.LayerInfos.Reverse <LayerInfo>())
            {
                Layers.Add(new ArcImsLayer(this, layerInfo));
            }

            CreateLayerHierarchy();
            List <CommonLayer> topLayers = TopLevelLayers;

            Layers.Clear();
            AddLayersFromHierarchy(topLayers);
        }
示例#5
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;
                }
            }
        }
示例#6
0
 public TocLoader(ArcImsService service, int swatchWidth, int swatchHeight)
 {
     _service     = service;
     _swatchMaker = new SwatchMaker(service, swatchWidth, swatchHeight);
 }
示例#7
0
 public TocLoader(ArcImsService service) : this(service, 16, 16)
 {
 }
示例#8
0
        public Response Send(ArcImsService service, Request request)
        {
            WebResponse webResponse = Send(service.Name, request);

            return(Receive(webResponse));
        }
示例#9
0
 public ArcImsMap(ArcImsService service, int width, int height, Envelope extent) : this((ArcImsDataFrame)service.DefaultDataFrame, width, height, extent)
 {
 }
示例#10
0
 public static string GetSwatchName(ArcImsService service, string layerID, int valueIndex)
 {
     return(GetSwatchName(service, layerID) + "_" + valueIndex.ToString());
 }
示例#11
0
        public static string GetSwatchName(ArcImsService service, string layerID)
        {
            string host = service.Host.ServerUrl.Replace("http://", "").Replace("https://", "").Replace(":", "_");

            return(host + "_" + service.Name + "_" + layerID.Replace(" ", "_"));
        }