Пример #1
0
        private void SetLegendPositionFromCorner()
        {
            MapWinGIS.Point pt = new MapWinGIS.Point();
            switch (_legendCornerPosition)
            {
            case "topLeft":
                pt.x = Graticule.GraticuleExtents.xMin;
                pt.y = Graticule.GraticuleExtents.yMax;
                break;

            case "topRight":
                pt.x = Graticule.GraticuleExtents.xMax;
                pt.y = Graticule.GraticuleExtents.yMax;
                break;

            case "bottomLeft":
                pt.x = Graticule.GraticuleExtents.xMin;
                pt.y = Graticule.GraticuleExtents.yMin;
                break;

            case "bottomRight":
                pt.x = Graticule.GraticuleExtents.xMax;
                pt.y = Graticule.GraticuleExtents.yMin;
                break;
            }
            double pixelX = 0;
            double pixelY = 0;

            _mapControl.ProjToPixel(pt.x, pt.y, ref pixelX, ref pixelY);
            _legendAnchorCorner = new MapWinGIS.Point()
            {
                x = pixelX,
                y = pixelY
            };
        }