fdgdf fggg sdfsdf dfgfg dfg 

SharpMap基本概念
How do I create a map?

SharpMap.Map myMap = new SharpMap.Map(new Size(400,300));

myMap.MinimumZoom = 100; //Minimum zoom allowed

myMap.BackgroundColor = Color.White; //Set background

myMap.Center = new SharpMap.Geometry.Point(725000, 6180000); //Set center of map

myMap.Zoom = 1200; //Set zoom level

myMap.Size = new System.Drawing.Size(300,200); //Set output size



//Add PostGIS layer:

SharpMap.Layers.VectorLayer myLayer = new SharpMap.Layers.VectorLayer("My layer");

string ConnStr = "Server=127.0.0.1;Port=5432;UserId=postgres;Password=password;Database=myGisDb;";

myLayer.DataSource = new SharpMap.Providers.PostGIS(ConnStr, "myTable", "the_geom", 32632);

myLayer.MaxVisible = 40000;

myMap.Layers.Add(myLayer);



//Render the map

System.Drawing.Image imgMap = myMap.GetMap();


 

1234567890
創作者介紹

兢兢业业

dfdnewrtkrfvfr 發表在 痞客邦 PIXNET 留言(0) 人氣()