コード例 #1
0
ファイル: OgrSample.cs プロジェクト: cugkgq/Project
        internal static Map InitializeMap(float angle, string[] filenames)
        {
            var providers = new SharpMap.Data.Providers.Ogr[filenames.Length];

            for (int i = 0; i < filenames.Length; i++)
            {
                providers[i] = new Ogr(filenames[i]);
            }

            var map = LayerTools.GetMapForProviders(providers);

            Matrix mat = new Matrix();

            mat.RotateAt(angle, map.WorldToImage(map.Center));
            map.MapTransform = mat;
            map.ZoomToExtents();
            return(map);
        }
コード例 #2
0
        internal static Map InitializeMap(float angle, string[] filenames)
        {
            if (filenames == null)
            {
                return(null);
            }

            var providers = new SharpMap.Data.Providers.ShapeFile[filenames.Length];

            for (int i = 0; i < filenames.Length; i++)
            {
                providers[i] = new ShapeFile(filenames[i], true);
                providers[i].Open();
            }

            var map = LayerTools.GetMapForProviders(providers);

            Matrix mat = new Matrix();

            mat.RotateAt(angle, map.WorldToImage(map.Center));
            map.MapTransform = mat;

            return(map);
        }