How do i draw a polygon using sharp map

المشرف العام

Administrator
طاقم الإدارة
I am trying to put an image and draw a polygon and around that point and line to another image . i tried following code from sharp map but its shows many erors. So that i cant test with my map.code from shrpmap

SharpMap.Map mymap = new SharpMap.Map(new Size(100,100)); SharpMap.Layers.VectorLayer vectorLayer = new VectorLayer("GeometryLayer"); Collection geomColl = new Collection(); //Get the default geometry factory GeoAPI.GeometryServices.Instance = new NetTopologySuite.NtsGeometryServices(); GeoAPI.Geometries.GeometryFactory gf = GeoAPI.GeometryServices.Instance.DefaultGeometryFactory; //Add a single Point geomColl.Add(gf.CreatePoint(10, 10)); //Add a LineString with 2 Points GeoAPI.Geometries.Coordinate[] points = new GeoAPI.Geometries.Coordinate { new GeoAPI.Geometries.Coordinate(10, 10), new GeoAPI.Geometries.Coordinate(20, 20), }; geomColl.Add(gf.CreateLineString(points)); vectorLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(GeomColl); mymap.Layers.Add(VLayer); Could anybody can give an example of this case



أكثر...
 
أعلى