コード例 #1
0
ファイル: CYZMapConfig.cs プロジェクト: 15831944/oldProject
        /**
         * @4ZoomwayScale
         */
        public void InitZoomwayScale()
        {
            MapMinX = ElectronTransferModel.Config.MapConfig.Instance.MapMinX;
            MapMaxX = ElectronTransferModel.Config.MapConfig.Instance.MapMaxX;
            MapMinY = ElectronTransferModel.Config.MapConfig.Instance.MapMinY;
            MapMaxY = ElectronTransferModel.Config.MapConfig.Instance.MapMaxY;

            Levels = ElectronTransferModel.Config.MapConfig.Instance.Levels;
            if (ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale != null)
            {
                Levels = ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale.Count;
            }
            PicWidth  = ElectronTransferModel.Config.MapConfig.Instance.PicWidth;
            PicHeight = ElectronTransferModel.Config.MapConfig.Instance.PicHeight;

            BaseDir = ElectronTransferModel.Config.MapConfig.Instance.BaseDir;


            if (MapMinX == 0.0 && MapMaxX == 0.0)
            {
                return;
            }
            if (MapMinY == 0.0 && MapMaxY == 0.0)
            {
                return;
            }
            if (MapMinX == MapMaxX)
            {
                return;
            }
            if (MapMinY == MapMaxY)
            {
                return;
            }
            if (Levels == 0)
            {
                return;
            }

            MapLevels = new List <CYZLevelConfig>();
            for (int i = ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale.Count - 1; i >= 0; i--)
            {
                CYZLevelConfig clc = new CYZLevelConfig();
                clc.LevelID     = ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale.Count - 1 - i;
                clc.PicWidth    = PicWidth;
                clc.PicHeight   = PicHeight;
                clc.xResolution = ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale[i] * 0.0254 / DD / 96;
                clc.yResolution = clc.xResolution;

                clc.Scale = ElectronTransferModel.Config.MapConfig.Instance.ZoomWayScale[i];

                MapLevels.Add(clc);
            }
        }
コード例 #2
0
ファイル: CYZMapConfig.cs プロジェクト: 15831944/oldProject
        /**
         * @4叉树切片
         */
        public void Init4Tree()
        {
            MapMinX = ElectronTransferModel.Config.MapConfig.Instance.MapMinX;
            MapMaxX = ElectronTransferModel.Config.MapConfig.Instance.MapMaxX;
            MapMinY = ElectronTransferModel.Config.MapConfig.Instance.MapMinY;
            MapMaxY = ElectronTransferModel.Config.MapConfig.Instance.MapMaxY;

            Levels    = ElectronTransferModel.Config.MapConfig.Instance.Levels;
            PicWidth  = ElectronTransferModel.Config.MapConfig.Instance.PicWidth;
            PicHeight = ElectronTransferModel.Config.MapConfig.Instance.PicHeight;

            BaseDir = ElectronTransferModel.Config.MapConfig.Instance.BaseDir;


            if (MapMinX == 0.0 && MapMaxX == 0.0)
            {
                return;
            }
            if (MapMinY == 0.0 && MapMaxY == 0.0)
            {
                return;
            }
            if (MapMinX == MapMaxX)
            {
                return;
            }
            if (MapMinY == MapMaxY)
            {
                return;
            }
            if (Levels == 0)
            {
                return;
            }

            MapLevels = new List <CYZLevelConfig>();
            for (int i = 0; i < Levels; i++)
            {
                CYZLevelConfig clc = new CYZLevelConfig();
                clc.LevelID     = i;
                clc.PicWidth    = PicWidth;
                clc.PicHeight   = PicHeight;
                clc.xResolution = (MapMaxX - MapMinX) / (Math.Pow(2.0, (double)i) * clc.PicWidth);
                clc.yResolution = (MapMaxY - MapMinY) / (Math.Pow(2.0, (double)i) * clc.PicHeight);

                clc.Scale = clc.xResolution * DD * 96 / 0.0254;

                MapLevels.Add(clc);
            }
        }