Exemple #1
0
        public AgsMap(AgsDataFrame dataFrame, int width, int height, GeoAPI.Geometries.Envelope extent)
        {
            _service = dataFrame.Service as AgsMapService;

            DataFrame = dataFrame;
            Width     = width;
            Height    = height;
            Extent    = extent;
        }
Exemple #2
0
        public static AgsMapService LoadFrom(string fileName, AgsHost host)
        {
            BinaryFormatter formatter     = new BinaryFormatter();
            FileStream      fileStream    = new FileStream(fileName, FileMode.Open, FileAccess.Read);
            AgsMapService   agsMapService = formatter.Deserialize(fileStream) as AgsMapService;

            agsMapService.Host = host;
            fileStream.Dispose();
            return(agsMapService);
        }
        public AgsDataFrame(AgsMapService service, MapServerInfo mapServerInfo, bool isDefault)
        {
            _mapServerInfo = mapServerInfo;

            Service   = service;
            Name      = mapServerInfo.Name;
            IsDefault = isDefault;

            ImageType imageType = new ImageType(esriImageFormat.esriImagePNG, esriImageReturnType.esriImageReturnMimeData);

            MapServerLegendInfo[] legendInfos = service.MapServer.GetLegendInfo(mapServerInfo.Name, null, null, imageType, null, null);

            foreach (MapLayerInfo mapLayerInfo in mapServerInfo.MapLayerInfos)
            {
                MapServerLegendInfo mapServerLegendInfo = legendInfos.FirstOrDefault(li => li.LayerID == mapLayerInfo.LayerID);
                LayerDescription    layerDescription    = mapServerInfo.DefaultMapDescription.LayerDescriptions.First(ld => ld.LayerID == mapLayerInfo.LayerID);

                Layers.Add(new AgsLayer(this, mapLayerInfo, mapServerLegendInfo, layerDescription.Visible));
            }

            CreateLayerHierarchy();
        }
Exemple #4
0
 public AgsMap(AgsMapService service, int width, int height, GeoAPI.Geometries.Envelope extent) : this((AgsDataFrame)service.DefaultDataFrame, width, height, extent)
 {
 }