private void AddSineCurveLayers(Map map, LabelLayerMode mode,
                                        LabelStyle.HorizontalAlignmentEnum hzAlign,
                                        LabelStyle.VerticalAlignmentEnum vtAlign)
        {
            string text;

            switch (mode)
            {
            case LabelLayerMode.SineCurveExtended:
                text =
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam";    //", quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
                break;

            default:
                text = "Lorem ipsum olor sit amet, consectetur adipisici elit";
                break;
            }

            var fdt = new SharpMap.Data.FeatureDataTable();

            fdt.BeginInit();
            fdt.Columns.Add(new System.Data.DataColumn("ID", typeof(int)));
            fdt.Columns.Add(new System.Data.DataColumn("LABEL", typeof(string)));
            fdt.PrimaryKey = new[] { fdt.Columns[0] };
            fdt.EndInit();
            fdt.BeginLoadData();
            var fdr = (SharpMap.Data.FeatureDataRow)fdt.LoadDataRow(new object[] { 1, text }, true);

            fdr.Geometry = CreateSineLine(new GeoAPI.Geometries.Coordinate(10, 10));
            fdt.EndLoadData();

            var vLyr = new SharpMap.Layers.VectorLayer("Geometry", new GeometryFeatureProvider(fdt));

            vLyr.Style.Line    = new System.Drawing.Pen(System.Drawing.Color.Black, 4);
            vLyr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            vLyr.SRID          = map.SRID;
            map.Layers.Add(vLyr);

            var lLyr = new SharpMap.Layers.LabelLayer("Label")
            {
                DataSource = vLyr.DataSource, LabelColumn = "LABEL"
            };

            lLyr.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
            lLyr.Style.ForeColor   = System.Drawing.Color.Cyan;
            lLyr.Style.BackColor   = new SolidBrush(Color.FromArgb(128, Color.LightSlateGray));
            //lLyr.Style.Halo = new Pen(Color.Yellow, 4);
            lLyr.Style.IgnoreLength        = mode == LabelLayerMode.SineCurveExtended;
            lLyr.Style.HorizontalAlignment = hzAlign;
            lLyr.Style.VerticalAlignment   = vtAlign;
            //ll.Style.IsTextOnPath = textOnPath;
            map.Layers.Add(lLyr);
        }
        private static FeatureDataTable CreateFeatureDataTable(IFeature feature)
        {
            var res = new FeatureDataTable();

            res.BeginInit();
            foreach (string key in feature.Attributes.Keys)
            {
                object value = feature.Attributes[key];
                res.Columns.Add(key, value?.GetType() ?? typeof(object));
            }
            res.EndInit();
            return(res);
        }