On Adding Angle Control to the Project Form (Version 4.0.0.0) I get an immediate error.
TEXT
Any help or direction would be great
TEXT
Any help or direction would be great
private DotSpatial.Positioning.Forms.Compass Compass;
private DotSpatial.Symbology.Forms.AngleControl acHeading;
I could really use some help understanding this.IFeatureSet featureSet = null;
//Getting the right featureset from map
foreach (var x in appManager.Map.GetPolygonLayers())
{
if (!string.Equals(x.DataSet.Name, layerName)) continue;
featureSet = x.DataSet as FeatureSet;
break;
}
var polygon = CreatePolygon(polyline);
//Creating feature and adding to FeatureSet
var feature = featureSet.AddFeature(polygon);
//Populating DataRow with information
AddinfoIntoDataTable(feature, polygon, textInDxf);
return feature;
} featureLayer.DataSet.UpdateExtent();
featureLayer.DataSet.InitializeVertices();
featureLayer.LabelLayer?.CreateLabels();
if(save)
{
featureLayer.DataSet.Save();
featureLayer.DataSet.Close();
}
featureLayer.AssignFastDrawnStates();
AppManager.Map.Refresh();
AppManager.Map.ResetBuffer();
where featureLayer is IFeatureLayer.public void Save()
{
foreach(var featureLayer in AppManager.Map.GetPolygonLayers())
{
featureLayer.DataSet.Save();
}
}
Hope that helps someone. FeatureSet fs = new FeatureSet(FeatureType.Polygon);
Coordinate[] coord = new Coordinate[5];
coord[0] = new Coordinate(30, 48);
coord[1] = new Coordinate(120, 45);
coord[2] = new Coordinate(-170, 64);
coord[3] = new Coordinate(30, 70);
coord[4] = new Coordinate(30, 48);
Polygon pg = new Polygon(coord);
pg.Normalize();
fs.Features.Add(pg);
fs.Projection = DotSpatial.Projections.KnownCoordinateSystems.Geographic.World.WGS1984;
fs.SaveAs(HttpContext.Current.Server.MapPath("~/shp/test2.shp"), true);
However, when I check the shape file, the polygon comes out to be AppManager.SerializationManager.SaveProject(fileName)
AppManager.SerializationManager.OpenProject(fileName)
after you've called AppManager.LoadExtensions()
The WebMap plugin listens to the App.SerializationManager.Serializing and App.SerializationManager.Deserializing events, writing its settings to the dspx and reading them from there again.