private void FormLayerListImageGenerator_Load(object sender, System.EventArgs e)
        {
            this.SizeChanged += Form_SizeChanged;

            _boat = Resources.vessel_01;

            InitMap();
            InitBackground();
            InitLayers();
            InitVariableLayers();
            InitTreeView();
            InitRotations();

            using (var renderer = SharpMap.Forms.MapBox.MapImageGeneratorFunction(new SharpMap.Forms.MapBox(), null))
            {
                if (renderer is SharpMap.Forms.ImageGenerator.LegacyMapBoxImageGenerator)
                {
                    this.txtImgGeneration.Text = (this.txtImgGeneration.Text + "\n.    LegacyMapImageRenderer");
                }
                else
                {
                    this.txtImgGeneration.Text = (this.txtImgGeneration.Text + "\n.    LayerListImageGenerator");
                }
            };

            this.mb.Refresh();

            //_slowBoats?.Start();
            _mediumBoats?.Start();
            //_fastBoats?.Start();
        }
        private void MenuItemClick(Object sender, EventArgs e)
        {
            var mi = sender as MenuItem;

            if (mi == null)
            {
                return;
            }

            var vectorLyr = _contextLayer as VectorLayer;
            var lblLyr    = _contextLayer as LabelLayer;

            switch ((enumMenuItem)mi.Tag)
            {
            //case enumMenuItem.Refresh:
            //    this.mb.Refresh();
            //    break;
            case enumMenuItem.StartMoving:
                if (_contextLayer.LayerName.StartsWith("Fast"))
                {
                    _fastBoats?.Start();
                }
                else if (_contextLayer.LayerName.StartsWith("Slow"))
                {
                    _slowBoats?.Start();
                }
                else
                {
                    _mediumBoats?.Start();
                }
                break;

            case enumMenuItem.StopMoving:
                if (_contextLayer.LayerName.StartsWith("Fast"))
                {
                    _fastBoats?.Stop();
                }
                else if (_contextLayer.LayerName.StartsWith("Slow"))
                {
                    _slowBoats?.Stop();
                }
                else
                {
                    _mediumBoats?.Stop();
                }
                break;

            case enumMenuItem.IncrementLabelSize:
                lblLyr.Style.Font = new Font(lblLyr.Style.Font.FontFamily, lblLyr.Style.Font.Size + 2);
                break;

            case enumMenuItem.DecrementLabelSize:
                lblLyr.Style.Font = new Font(lblLyr.Style.Font.FontFamily, lblLyr.Style.Font.Size - 2);
                break;

            case enumMenuItem.RegularSymbolizer:
                InitRasterPointSymbolizer(vectorLyr, 0);
                break;

            case enumMenuItem.ThematicSymbolizer:
                InitRasterPointSymbolizer(vectorLyr, 1);
                break;

            case enumMenuItem.IncreaseSymbolSize:
                vectorLyr.Style.PointSize += 2;
                break;

            case enumMenuItem.DecreaseSymbolSize:
                vectorLyr.Style.PointSize -= 2;
                break;

            case enumMenuItem.SymbolOffsetTL:
                vectorLyr.Style.SymbolOffset = new PointF(vectorLyr.Style.SymbolOffset.X - 10f, vectorLyr.Style.SymbolOffset.Y - 10f);
                break;

            case enumMenuItem.SymbolOffsetTR:
                vectorLyr.Style.SymbolOffset = new PointF(vectorLyr.Style.SymbolOffset.X + 10f, vectorLyr.Style.SymbolOffset.Y - 10f);
                break;

            case enumMenuItem.SymbolOffsetNone:
                vectorLyr.Style.SymbolOffset = new PointF(0, 0);
                break;

            case enumMenuItem.SymbolOffsetBL:
                vectorLyr.Style.SymbolOffset = new PointF(vectorLyr.Style.SymbolOffset.X - 10f, vectorLyr.Style.SymbolOffset.Y + 10f);
                break;

            case enumMenuItem.SymbolOffsetBR:
                vectorLyr.Style.SymbolOffset = new PointF(vectorLyr.Style.SymbolOffset.X + 10f, vectorLyr.Style.SymbolOffset.Y + 10f);
                break;

            case enumMenuItem.AlignHz:
                if (vectorLyr.Theme == null)
                {
                    PopulateGeomFeatureLayer(mb.Map, vectorLyr, 0);
                }
                else
                {
                    PopulateCharacterPointSymbolizerLayer(mb.Map, (GeometryFeatureProvider)vectorLyr.DataSource, 0);
                }
                break;

            case enumMenuItem.AlignVt:
                if (vectorLyr.Theme == null)
                {
                    PopulateGeomFeatureLayer(mb.Map, vectorLyr, 1);
                }
                else
                {
                    PopulateCharacterPointSymbolizerLayer(mb.Map, (GeometryFeatureProvider)vectorLyr.DataSource, 1);
                }
                break;

            case enumMenuItem.AlignDiagonal:
                if (vectorLyr.Theme == null)
                {
                    PopulateGeomFeatureLayer(mb.Map, vectorLyr, 2);
                }
                else
                {
                    PopulateCharacterPointSymbolizerLayer(mb.Map, (GeometryFeatureProvider)vectorLyr.DataSource, 2);
                }
                break;

            case enumMenuItem.IncrementLineWidth:
                vectorLyr.Style.Line.Width += 1;
                break;

            case enumMenuItem.DecrementLineWidth:
                vectorLyr.Style.Line.Width -= vectorLyr.Style.Line.Width <= 1 ? 0 : 1;
                break;

            default:
                break;
            }

            this.mb.Refresh();
        }