From 6304b7d15ba8d09a13de34dd4fc810956fe45f0b Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 13 Dec 2024 21:52:22 +0000 Subject: [PATCH] LazMapViewer: Some renaming in the grid plugin unit. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9528 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../grid_demo/GridPlugin_Demo.lpr | 3 +- .../examples/plugin_demos/grid_demo/main.lfm | 2 +- .../examples/plugin_demos/grid_demo/main.pas | 58 +++--- components/lazmapviewer/lazmapviewerpkg.lpk | 4 +- components/lazmapviewer/lazmapviewerpkg.pas | 2 +- .../{mvgridplugin.pas => mvmapgridplugin.pas} | 194 ++++++++---------- 6 files changed, 119 insertions(+), 144 deletions(-) rename components/lazmapviewer/source/addons/plugins/grids/{mvgridplugin.pas => mvmapgridplugin.pas} (77%) diff --git a/components/lazmapviewer/examples/plugin_demos/grid_demo/GridPlugin_Demo.lpr b/components/lazmapviewer/examples/plugin_demos/grid_demo/GridPlugin_Demo.lpr index 48259d746..874ffaf09 100644 --- a/components/lazmapviewer/examples/plugin_demos/grid_demo/GridPlugin_Demo.lpr +++ b/components/lazmapviewer/examples/plugin_demos/grid_demo/GridPlugin_Demo.lpr @@ -10,8 +10,7 @@ uses athreads, {$ENDIF} Interfaces, // this includes the LCL widgetset - Forms, lazcontrols, main - { you can add units after this }; + Forms, main; {$R *.res} diff --git a/components/lazmapviewer/examples/plugin_demos/grid_demo/main.lfm b/components/lazmapviewer/examples/plugin_demos/grid_demo/main.lfm index 25e8e3c15..79fbc02d2 100644 --- a/components/lazmapviewer/examples/plugin_demos/grid_demo/main.lfm +++ b/components/lazmapviewer/examples/plugin_demos/grid_demo/main.lfm @@ -106,7 +106,7 @@ object Form1: TForm1 '10°' '5°' '2°' - '1"' + '1°' '30''' '20''' '10''' diff --git a/components/lazmapviewer/examples/plugin_demos/grid_demo/main.pas b/components/lazmapviewer/examples/plugin_demos/grid_demo/main.pas index 376d7695f..a88c93d34 100644 --- a/components/lazmapviewer/examples/plugin_demos/grid_demo/main.pas +++ b/components/lazmapviewer/examples/plugin_demos/grid_demo/main.pas @@ -7,7 +7,7 @@ interface uses Classes, ComCtrls, DividerBevel, ExtCtrls, Spin, StdCtrls, SysUtils, Forms, Controls, Graphics, Dialogs, //LazLogger, - mvMapViewer, mvTypes, mvEngine, mvPluginCore, mvGridPlugin; + mvMapViewer, mvTypes, mvEngine, mvPluginCore, mvMapGridPlugin; type TForm1 = class(TForm) @@ -47,7 +47,8 @@ type procedure seLabelDistanceChange(Sender: TObject); procedure tbOpacityChange(Sender: TObject); private - procedure AddPointOfInterest(X, Y: Integer); + FMapGridPlugin: TMapGridPlugin; + procedure AddOrDeletePointOfInterest(X, Y: Integer); public @@ -64,16 +65,15 @@ procedure TForm1.FormCreate(Sender: TObject); begin Randomize; MapView.Zoom := 5; - with TGridPlugin.Create(PluginManager) do - begin - clbBackgroundColor.ButtonColor := ColorToRGB(BackgroundColor); - clbPenColor.ButtonColor := ColorToRGB(Pen.Color); - clbLabelTextColor.ButtonColor := ColorToRGB(Font.Color); - tbOpacity.Position := round(Opacity * 100); - end; + FMapGridPlugin := TMapGridPlugin.Create(PluginManager); + + clbBackgroundColor.ButtonColor := ColorToRGB(FMapGridPlugin.BackgroundColor); + clbPenColor.ButtonColor := ColorToRGB(FMapGridPlugin.Pen.Color); + clbLabelTextColor.ButtonColor := ColorToRGB(FMapGridPlugin.Font.Color); + tbOpacity.Position := round(FMapGridPlugin.BackgroundOpacity * 100); end; -procedure TForm1.AddPointOfInterest(X, Y: Integer); +procedure TForm1.AddOrDeletePointOfInterest(X, Y: Integer); const DELTA = 4; var @@ -120,22 +120,22 @@ end; procedure TForm1.cbEnabledChange(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).Enabled := cbEnabled.Checked; + FMapGridPlugin.Enabled := cbEnabled.Checked; end; procedure TForm1.clbBackgroundColorColorChanged(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).BackgroundColor := clbBackgroundColor.ButtonColor; + FMapGridPlugin.BackgroundColor := clbBackgroundColor.ButtonColor; end; procedure TForm1.clbLabelTextColorColorChanged(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).Font.Color := clbLabelTextColor.ButtonColor; + FMapGridPlugin.Font.Color := clbLabelTextColor.ButtonColor; end; procedure TForm1.clbPenColorColorChanged(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).Pen.Color := clbPenColor.ButtonColor; + FMapGridPlugin.Pen.Color := clbPenColor.ButtonColor; end; procedure TForm1.cmbIncrementChange(Sender: TObject); @@ -145,7 +145,7 @@ var p: Integer; begin if cmbIncrement.ItemIndex <= 0 then - (PluginManager.PluginList[0] as TGridPlugin).Increment := 0 + FMapGridPlugin.Increment := 0 else begin s := cmbIncrement.Items[cmbIncrement.ItemIndex]; @@ -167,51 +167,51 @@ begin end; end; s := copy(s, 1, p-1); - (PluginManager.PluginList[0] as TGridPlugin).Increment := StrToInt(s) * multiplier; + FMapGridPlugin.Increment := StrToInt(s) * multiplier; end; end; procedure TForm1.LabelPositionChange(Sender: TObject); begin - with (PluginManager.PluginList[0] as TGridPlugin).GridLabels do + with FMapGridPlugin do begin if cbLeft.Checked then - Position := Position + [glpLeft] + LabelPositions := LabelPositions + [glpLeft] else - Position := Position - [glpLeft]; + LabelPositions := LabelPositions - [glpLeft]; if cbTop.Checked then - Position := Position + [glpTop] + LabelPositions := LabelPositions + [glpTop] else - Position := Position - [glpTop]; + LabelPositions := LabelPositions - [glpTop]; if cbRight.Checked then - Position := Position + [glpRight] + LabelPositions := LabelPositions + [glpRight] else - Position := Position - [glpRight]; + LabelPositions := LabelPositions - [glpRight]; if cbBottom.Checked then - Position := Position + [glpBottom] + LabelPositions := LabelPositions + [glpBottom] else - Position := Position - [glpBottom]; + LabelPositions := LabelPositions - [glpBottom]; end; end; procedure TForm1.MapViewMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin - if Button = mbRight then - AddPointOfInterest(X, Y); + if (Button = mbRight) and (Shift = []) then + AddOrDeletePointOfInterest(X, Y); end; procedure TForm1.seLabelDistanceChange(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).GridLabels.Distance := seLabelDistance.Value; + FMapGridPlugin.LabelDistance := seLabelDistance.Value; end; procedure TForm1.tbOpacityChange(Sender: TObject); begin - (PluginManager.PluginList[0] as TGridPlugin).Opacity := tbOpacity.Position / 100; + FMapGridPlugin.BackgroundOpacity := tbOpacity.Position / 100; end; end. diff --git a/components/lazmapviewer/lazmapviewerpkg.lpk b/components/lazmapviewer/lazmapviewerpkg.lpk index efdc77b43..2952b602a 100644 --- a/components/lazmapviewer/lazmapviewerpkg.lpk +++ b/components/lazmapviewer/lazmapviewerpkg.lpk @@ -145,8 +145,8 @@ FPC 3.2.0 or newer required."/> - - + + diff --git a/components/lazmapviewer/lazmapviewerpkg.pas b/components/lazmapviewer/lazmapviewerpkg.pas index 8485b4189..2aa0ef87a 100644 --- a/components/lazmapviewer/lazmapviewerpkg.pas +++ b/components/lazmapviewer/lazmapviewerpkg.pas @@ -14,7 +14,7 @@ uses mvDLEWin, mvMapViewerPropEdits, mvLayersPropEditForm, mvGeoMath, mvMapViewerPathEditForm, mvMapViewerPathEditDsgForm, mvDLECache, mvPluginEditors, mvClassRegistration, mvPluginCore, mvPlugins, - mvspreadmarker_plugin, uInactivityAlarmTimer, mvGridPlugin, + mvspreadmarker_plugin, uInactivityAlarmTimer, mvMapGridPlugin, mvMapScalePlugin, LazarusPackageIntf; implementation diff --git a/components/lazmapviewer/source/addons/plugins/grids/mvgridplugin.pas b/components/lazmapviewer/source/addons/plugins/grids/mvmapgridplugin.pas similarity index 77% rename from components/lazmapviewer/source/addons/plugins/grids/mvgridplugin.pas rename to components/lazmapviewer/source/addons/plugins/grids/mvmapgridplugin.pas index ca1ea9512..f401f9f10 100644 --- a/components/lazmapviewer/source/addons/plugins/grids/mvgridplugin.pas +++ b/components/lazmapviewer/source/addons/plugins/grids/mvmapgridplugin.pas @@ -1,6 +1,6 @@ -{ TGridPlugin - draws a grid of constant longitudes and constant latitudes} +{ TMapGridPlugin - draws a grid of constant longitudes and constant latitudes} -unit mvGridPlugin; +unit mvMapGridPlugin; {$mode objfpc}{$H+} @@ -12,48 +12,37 @@ uses mvMapViewer, mvDrawingEngine, mvPluginCore, mvGeoMath, mvTypes; type - TGridPlugin = class; - TMvGridLabelPosition = (glpLeft, glpTop, glpRight, glpBottom); - TMvGridLabelPositions = set of TMvGridLabelPosition; + TMapGridPlugin = class; + TMapGridLabelPosition = (glpLeft, glpTop, glpRight, glpBottom); + TMapGridLabelPositions = set of TMapGridLabelPosition; - TMvGridLabels = class(TPersistent) - private - FPlugin: TGridPlugin; - FPosition: TMvGridLabelPositions; - FDistance: Integer; - procedure SetDistance(AValue: Integer); - procedure SetPosition(AValue: TMvGridLabelpositions); - protected - procedure Update; - public - constructor Create(AOwner: TGridPlugin); - published - property Distance: Integer read FDistance write SetDistance default 0; - property Position: TMvGridLabelPositions read FPosition write SetPosition default [glpLeft, glpTop]; - end; - - TGridPlugin = class(TMvPlugin) + TMapGridPlugin = class(TMvPlugin) private const + DEFAULT_LABEL_POSITIONS = [glpLeft, glpTop]; DEFAULT_MAX_DISTANCE = 200; DEFAULT_MIN_DISTANCE = 80; + DEFAULT_OPACITY = 0.55; type TGridCoordType = (gctLatitude, gctLongitude); private FBackgroundColor: TColor; + FBackgroundOpacity: Single; FFont: TFont; FIncrement: Double; - FOpacity: Single; FPen: TPen; - FGridLabels: TMvGridLabels; + FLabelDistance: Integer; + FLabelPositions: TMapGridLabelPositions; FMaxDistance: Integer; FMinDistance: Integer; procedure SetBackgroundColor(AValue: TColor); + procedure SetBackgroundOpacity(AValue: Single); procedure SetFont(AValue: TFont); procedure SetIncrement(AValue: Double); + procedure SetLabelDistance(AValue: Integer); + procedure SetLabelPositions(AValue: TMapGridLabelPositions); procedure SetMaxDistance(AValue: Integer); procedure SetMinDistance(AValue: Integer); - procedure SetOpacity(AValue: Single); procedure SetPen(AValue: TPen); private procedure Changed(Sender: TObject); @@ -71,12 +60,13 @@ type destructor Destroy; override; published property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clWhite; + property BackgroundOpacity: Single read FBackgroundOpacity write SetBackgroundOpacity; property Font: TFont read FFont write SetFont; - property GridLabels: TMvGridLabels read FGridLabels write FGridLabels; property Increment: Double read FIncrement write SetIncrement; // 0 = automatic increment detection + property LabelDistance: Integer read FLabelDistance write SetLabelDistance default 0; + property LabelPositions: TMapGridLabelPositions read FLabelPositions write SetLabelPositions default DEFAULT_LABEL_POSITIONS; property MaxDistance: Integer read FMaxDistance write SetMaxDistance default DEFAULT_MAX_DISTANCE; property MinDistance: Integer read FMinDistance write SetMinDistance default DEFAULT_MIN_DISTANCE; - property Opacity: Single read FOpacity write SetOpacity; property Pen: TPen read FPen write SetPen; end; @@ -85,64 +75,31 @@ implementation uses Types; -{ TMvGridLabels } -constructor TMvGridLabels.Create(AOwner: TGridPlugin); -begin - inherited Create; - FPlugin := AOwner; - FPosition := [glpLeft, glpTop]; -end; +{ TMapGridPlugin } -procedure TMvGridLabels.SetDistance(AValue: Integer); -begin - if FDistance <> AValue then - begin - FDistance := AValue; - FPlugin.Update; - end; -end; - -procedure TMvGridLabels.SetPosition(AValue: TMvGridLabelPositions); -begin - if FPosition <> AValue then - begin - FPosition := AValue; - Update; - end; -end; - -procedure TMvGridLabels.Update; -begin - FPlugin.Update; -end; - - -{ TGridPlugin } - -constructor TGridPlugin.Create(AOwner: TComponent); +constructor TMapGridPlugin.Create(AOwner: TComponent); begin inherited; FBackgroundColor := clWhite; - FOpacity := 0.55; + FBackgroundOpacity := DEFAULT_OPACITY; FFont := TFont.Create; FFont.OnChange := @Changed; FPen := TPen.Create; FPen.OnChange := @Changed; - FGridLabels := TMvGridLabels.Create(Self); FMaxDistance := DEFAULT_MAX_DISTANCE; FMinDistance := DEFAULT_MIN_DISTANCE; + FLabelPositions := DEFAULT_LABEL_POSITIONS; end; -destructor TGridPlugin.Destroy; +destructor TMapGridPlugin.Destroy; begin - FGridLabels.Free; FPen.Free; FFont.Free; inherited; end; -procedure TGridPlugin.BeforeDrawObjects(AMapView: TMapView; var Handled: Boolean); +procedure TMapGridPlugin.BeforeDrawObjects(AMapView: TMapView; var Handled: Boolean); var area: TRealArea; coordType: TGridCoordType; @@ -184,7 +141,7 @@ end; { Calculates the increment of the grid lines. Since, due to the projection, the latitude lines have a non-constant spacing, their increment is taken from the equator value, i.e. is assumed to be equal to the longitude lines spacing. } -function TGridPlugin.CalcIncrement(AMapView: TMapView; Area: TRealArea): Double; +function TMapGridPlugin.CalcIncrement(AMapView: TMapView; Area: TRealArea): Double; type TIncrement = (deg180, deg90, deg45, deg30, deg10, deg5, deg2, deg1, min30, min20, min10, min5, min2, min1, @@ -218,7 +175,7 @@ end; { Calculates the corner coordinates (in degrees) for the displayed map. The longitude values are expanded such that they increase monotonously from left to right. } -function TGridPlugin.CalcVisibleArea(AMapView: TMapView): TRealArea; +function TMapGridPlugin.CalcVisibleArea(AMapView: TMapView): TRealArea; var worldWidth: Integer; numWorlds: Integer; @@ -234,18 +191,18 @@ begin end; end; -procedure TGridPlugin.Changed(Sender: TObject); +procedure TMapGridPlugin.Changed(Sender: TObject); begin Update; end; -procedure TGridPlugin.DrawGridLine(ADrawingEngine: TMvCustomDrawingEngine; +procedure TMapGridPlugin.DrawGridLine(ADrawingEngine: TMvCustomDrawingEngine; AValue: Double; P1, P2: TPoint; AMapRect: TRect); var s: String; txtSize: TSize; - txtRect: array[TMvGridLabelPosition] of TRect; - glp: TMvGridLabelPosition; + txtRect: array[TMapGridLabelPosition] of TRect; + glp: TMapGridLabelPosition; coordType: TGridCoordType; begin if P1.Y = P2.Y then @@ -269,36 +226,36 @@ begin case coordType of gctLatitude: begin - if (glpLeft in FGridLabels.Position) and InRange(P1.X, AMapRect.Left, AMapRect.Right) then + if (glpLeft in FLabelPositions) and InRange(P1.X, AMapRect.Left, AMapRect.Right) then begin txtRect[glpLeft] := Rect(0, 0, txtSize.CX, txtSize.CY); - OffsetRect(txtRect[glpLeft], P1.X + FGridLabels.Distance, P1.Y - txtSize.CY div 2); + OffsetRect(txtRect[glpLeft], P1.X + FLabelDistance, P1.Y - txtSize.CY div 2); end else txtRect[glpLeft] := Rect(AMapRect.Left, P1.Y, AMapRect.Left, P1.Y); - if (glpRight in FGridLabels.Position) and InRange(P1.X, AMapRect.Left, AMapRect.Right) then + if (glpRight in FLabelPositions) and InRange(P1.X, AMapRect.Left, AMapRect.Right) then begin txtRect[glpRight] := Rect(0, 0, txtSize.CX, txtSize.CY); - OffsetRect(txtRect[glpRight], P2.X - txtSize.CX - FGridLabels.Distance, P1.Y - txtSize.CY div 2); + OffsetRect(txtRect[glpRight], P2.X - txtSize.CX - FLabelDistance, P1.Y - txtSize.CY div 2); end else txtRect[glpRight] := Rect(AMapRect.Right, P1.Y, AMapRect.Right, P1.Y); end; gctLongitude: begin - if (glpTop in FGridLabels.Position) then + if (glpTop in FLabelPositions) then begin txtRect[glpTop] := Rect(0, 0, txtSize.CX, txtSize.CY); - OffsetRect(txtRect[glpTop], P1.X - txtSize.CX div 2, P1.Y + FGridlabels.Distance); + OffsetRect(txtRect[glpTop], P1.X - txtSize.CX div 2, P1.Y + FLabelDistance); end else txtRect[glpTop] := Rect(P1.X, AMapRect.Top, P1.X, AMapRect.Top); - if (glpBottom in FGridLabels.Position) then + if (glpBottom in FLabelPositions) then begin txtRect[glpBottom] := Rect(0, 0, txtSize.CX, txtSize.CY); - OffsetRect(txtRect[glpBottom], P1.X - txtSize.CX div 2, P2.Y - txtSize.CY - FGridLabels.Distance); + OffsetRect(txtRect[glpBottom], P1.X - txtSize.CX div 2, P2.Y - txtSize.CY - FLabelDistance); end else txtRect[glpBottom] := Rect(P1.X, AMapRect.Bottom, P1.X, AMapRect.Bottom); end; end; - for glp in TMvGridLabelPositions do + for glp in TMapGridLabelPositions do begin if txtRect[glp].Top < AMapRect.Top then OffsetRect(txtRect[glp], 0, AMapRect.Top - txtRect[glp].Top); if txtRect[glp].Bottom > AMapRect.Bottom then OffsetRect(txtRect[glp], 0, AMapRect.Bottom - txtRect[glp].Bottom); @@ -316,24 +273,24 @@ begin // Draw (semi-transparent) background if FBackgroundColor <> clNone then begin - ADrawingEngine.Opacity := FOpacity; + ADrawingEngine.Opacity := FBackgroundOpacity; ADrawingEngine.BrushStyle := bsSolid; case coordType of gctLatitude: begin - if (glpLeft in FGridLabels.Position) then + if (glpLeft in FLabelPositions) then with txtRect[glpLeft] do ADrawingEngine.FillRect(Left, Top, Right, Bottom); - if (glpRight in FGridLabels.Position) then + if (glpRight in FLabelPositions) then with txtRect[glpRight] do ADrawingEngine.FillRect(Left, Top, Right, Bottom); end; gctLongitude: begin - if (glpTop in FGridLabels.Position) then + if (glpTop in FLabelPositions) then with txtRect[glpTop] do ADrawingEngine.FillRect(Left, top, Right, Bottom); - if (glpBottom in FGridLabels.Position) then + if (glpBottom in FLabelPositions) then with txtRect[glpBottom] do ADrawingEngine.FillRect(Left, Top, Right, Bottom); end; @@ -346,18 +303,18 @@ begin case coordType of gctLatitude: begin - if glpLeft in FGridlabels.Position then + if glpLeft in FLabelPositions then with txtRect[glpLeft] do ADrawingEngine.TextOut(Left, Top, s); - if glpRight in FGridLabels.Position then + if glpRight in FLabelPositions then with txtRect[glpRight] do ADrawingEngine.TextOut(Left, Top, s); end; gctLongitude: begin - if glpTop in FGridLabels.Position then + if glpTop in FLabelPositions then with txtRect[glpTop] do ADrawingEngine.TextOut(Left, Top, s); - if glpBottom in FGridLabels.Position then + if glpBottom in FLabelPositions then with txtRect[glpBottom] do ADrawingEngine.TextOut(Left, Top, s); end; end; @@ -367,7 +324,7 @@ end; * Area - Area covered by the map, in (monotonous) degrees * AMapRect - dto., in pixels. * AIncrement - distance between grid lines, in degrees. } -procedure TGridPlugin.DrawHorGridLines(AMapView: TMapView; Area: TRealArea; +procedure TMapGridPlugin.DrawHorGridLines(AMapView: TMapView; Area: TRealArea; AMapRect: TRect; AIncrement: Double); var rP1, rP2: TRealPoint; // Top and bottom points of each gridline, in degrees @@ -414,7 +371,7 @@ end; * Area - Area covered by the map, in (monotonous) degrees * AMapRect - dto., in pixels. * AIncrement - distance between grid lines, in degrees. } -procedure TGridPlugin.DrawVertGridlines(AMapView: TMapView; Area: TRealArea; +procedure TMapGridPlugin.DrawVertGridlines(AMapView: TMapView; Area: TRealArea; AMapRect: TRect; AIncrement: Double); var rP1, rP2: TRealPoint; // top and bottom points of each gridline, in degrees @@ -463,7 +420,7 @@ begin end; end; -function TGridPlugin.GetLatLonAsString(AValue: Double; ACoordType: TGridCoordType): String; +function TMapGridPlugin.GetLatLonAsString(AValue: Double; ACoordType: TGridCoordType): String; var degs, mins, secs: Double; secsZero: Boolean; @@ -495,7 +452,7 @@ begin end; end; -procedure TGridPlugin.SetBackgroundColor(AValue: TColor); +procedure TMapGridPlugin.SetBackgroundColor(AValue: TColor); begin if FBackgroundColor <> AValue then begin @@ -504,13 +461,22 @@ begin end; end; -procedure TGridPlugin.SetFont(AValue: TFont); +procedure TMapGridPlugin.SetBackgroundOpacity(AValue: Single); +begin + if FBackgroundOpacity <> AValue then + begin + FBackgroundOpacity := AValue; + Update; + end; +end; + +procedure TMapGridPlugin.SetFont(AValue: TFont); begin FFont := AValue; Update; end; -procedure TGridPlugin.SetIncrement(AValue: Double); +procedure TMapGridPlugin.SetIncrement(AValue: Double); begin if FIncrement <> AValue then begin @@ -519,7 +485,25 @@ begin end; end; -procedure TGridPlugin.SetMaxDistance(AValue: Integer); +procedure TMapGridPlugin.SetLabelDistance(AValue: Integer); +begin + if FLabelDistance <> AValue then + begin + FLabelDistance := AValue; + Update; + end; +end; + +procedure TMapGridPlugin.SetLabelPositions(AValue: TMapGridLabelPositions); +begin + if FLabelPositions <> AValue then + begin + FLabelPositions := AValue; + Update; + end; +end; + +procedure TMapGridPlugin.SetMaxDistance(AValue: Integer); begin if FMaxDistance <> AValue then begin @@ -528,7 +512,7 @@ begin end; end; -procedure TGridPlugin.SetMinDistance(AValue: Integer); +procedure TMapGridPlugin.SetMinDistance(AValue: Integer); begin if FMinDistance <> AValue then begin @@ -537,23 +521,15 @@ begin end; end; -procedure TGridPlugin.SetOpacity(AValue: Single); -begin - if FOpacity <> AValue then - begin - FOpacity := AValue; - Update; - end; -end; - -procedure TGridPlugin.SetPen(AValue: TPen); +procedure TMapGridPlugin.SetPen(AValue: TPen); begin FPen.Assign(AValue); Update; end; + initialization - RegisterPluginClass(TGridPlugin, 'Degrees grid'); + RegisterPluginClass(TMapGridPlugin, 'Map grid'); end.