LazMapViewer: Add mini documentation to the header of some plugin files. Less hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9697 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
34b247e060
commit
6ef401c2e3
@ -1,4 +1,60 @@
|
||||
{ TMapGridPlugin - draws a grid of constant longitudes and constant latitudes}
|
||||
{-------------------------------------------------------------------------------
|
||||
mvGridPlugins.pas
|
||||
|
||||
License: modified LGPL with linking exception (like RTL, FCL and LCL)
|
||||
|
||||
See the file COPYING.modifiedLGPL.txt, included in the Lazarus distribution,
|
||||
for details about the license.
|
||||
|
||||
See also: https://wiki.lazarus.freepascal.org/FPC_modified_LGPL
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
TMapGridPlugin
|
||||
--------------
|
||||
|
||||
The TMapGridPlugin draws a grid of lines at constant and equidistant latitudes
|
||||
and longitudes. The lines can be labeled at both sides by the longitude/latitude
|
||||
values.
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
BackgroundColor: TColor
|
||||
Color of the (semi-transparent) label background
|
||||
|
||||
BackgroundOpacity: Single
|
||||
Determines the transparency of the label background
|
||||
(0 = transparent, 1 = opaque)
|
||||
|
||||
Font: TFont
|
||||
Font to be used to draw the labels at the grid lines
|
||||
|
||||
LabelDistacne: Integer
|
||||
Distance of the labels from the map edges
|
||||
|
||||
LabelPositions: TMvGridLabelPositions
|
||||
a set of [glpLeft, glpTop, glpRight, glpBottom] indicating the map sides
|
||||
at which the labels are drawn
|
||||
|
||||
Increment: Double
|
||||
Distance between the grid lines, in (fractional) degress
|
||||
The same value Will be applied to both equal-longitude and equal-latitude lines
|
||||
Note that the distance between equal-latitude lines will grow towards the
|
||||
poles, due to the projection of the map.
|
||||
The default value, 0, instructs the plugin to calculate the increment
|
||||
automatically (determined by MaxDistance and MinDistance parameters).
|
||||
|
||||
MaxDistance: Integer
|
||||
The maximum distance between vertical grid lines in pixels limiting the
|
||||
automatic calculation of the Increment parameter.
|
||||
|
||||
MinDistance: Integer
|
||||
The minimum distance between vertical grid lines in pixels limiting the
|
||||
automatic calculation of the Increment parameter.
|
||||
|
||||
Pen: TPen
|
||||
Determines the color, width and style of the grid lines
|
||||
-------------------------------------------------------------------------------}
|
||||
|
||||
unit mvMapGridPlugin;
|
||||
|
||||
|
@ -1,3 +1,38 @@
|
||||
{-------------------------------------------------------------------------------
|
||||
mvMarkerPlugins.pas
|
||||
|
||||
License: modified LGPL with linking exception (like RTL, FCL and LCL)
|
||||
|
||||
See the file COPYING.modifiedLGPL.txt, included in the Lazarus distribution,
|
||||
for details about the license.
|
||||
|
||||
See also: https://wiki.lazarus.freepascal.org/FPC_modified_LGPL
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
This unit collects some typical marker-related plugins:
|
||||
|
||||
- TMarkerHintPlugin
|
||||
displays a hint when the mouse hovers over a GPSPoint or a MapPoint.
|
||||
Handle the OnHint event to define the exact string to be displayed in the
|
||||
popup hint window.
|
||||
|
||||
- TMarkerClickPlugin
|
||||
Fires the OnMarkerClick event when the user clicks on a GPSPoint or a
|
||||
MapPoint. Which mouse key and modification shift key (CTRL, SHIFT, ALT)
|
||||
triggers the event, is defined by the Shift property.
|
||||
|
||||
- TMarkerEditorPlugin
|
||||
Allows to add new GPSPoints or MapPoints, to select them by clicking and
|
||||
to drag them to another location. There are also methods to convert a group
|
||||
of selected markers to a GPSTrack/MapTrack or GPSArea/MapArea, or to
|
||||
delete the points in this selection.
|
||||
|
||||
- TDraggableMarkerPlugin
|
||||
Allows to drag the marker hit by pressing the mouse button to a new location.
|
||||
Unlike the TMarkerEditorPlugin data are handled such that multiple maps
|
||||
can be processed by the same plugin.
|
||||
-------------------------------------------------------------------------------}
|
||||
|
||||
unit mvMarkerPlugins;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
@ -5,7 +40,7 @@ unit mvMarkerPlugins;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Contnrs,
|
||||
Classes, SysUtils,
|
||||
Graphics, Controls, Forms, LCLIntf,
|
||||
mvMapViewer, mvDrawingEngine, mvPluginCommon, mvGPSObj, mvGeoMath, mvTypes;
|
||||
|
||||
@ -446,8 +481,6 @@ function TMarkerEditorPlugin.ConvertSelectedPointsToGPSArea(
|
||||
AMapView: TMapView; AreaID: Integer): TGPSArea;
|
||||
var
|
||||
M: TMarkerData;
|
||||
P: TGPSPoint;
|
||||
i: Integer;
|
||||
begin
|
||||
if FSelection.Count < 3 then
|
||||
raise EMvPluginException.Create('For an area, the selection must contain at least 3 points.');
|
||||
@ -492,8 +525,6 @@ function TMarkerEditorPlugin.ConvertSelectedPointsToGPSTrack(
|
||||
AMapView: TMapView; ATrackID: Integer): TGPSTrack;
|
||||
var
|
||||
M: TMarkerData;
|
||||
P: TGPSPoint;
|
||||
i: Integer;
|
||||
begin
|
||||
if FSelection.Count < 2 then
|
||||
raise EMvPluginException.Create('For a track, the selection must contain at least 2 points.');
|
||||
@ -540,7 +571,7 @@ end;
|
||||
procedure TMarkerEditorPlugin.DeleteFromList(AMapView: TMapView;
|
||||
APoint: TGPSPoint);
|
||||
var
|
||||
gpsObj: TGPSObj;
|
||||
gpsObj: TGPSObj = nil;
|
||||
collection: TMapCollectionBase = nil;
|
||||
idx: Integer = -1;
|
||||
begin
|
||||
|
@ -7,7 +7,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, Contnrs,
|
||||
Graphics, Controls, Forms, LCLIntf, //LazLoggerBase,
|
||||
mvMapViewer, mvDrawingEngine, mvPluginCommon, mvGPSObj, mvGeoMath, mvTypes;
|
||||
mvMapViewer, mvDrawingEngine, mvPluginCommon, mvGPSObj, mvTypes;
|
||||
|
||||
type
|
||||
{ TCenterMarkerPlugin - draws a cross in the map center }
|
||||
|
@ -1,4 +1,67 @@
|
||||
{ TMapScalePlugin - draws a length scale corresponding to the current zoom level }
|
||||
{-------------------------------------------------------------------------------
|
||||
mvMapScalePlugin.pas
|
||||
|
||||
License: modified LGPL with linking exception (like RTL, FCL and LCL)
|
||||
|
||||
See the file COPYING.modifiedLGPL.txt, included in the Lazarus distribution,
|
||||
for details about the license.
|
||||
|
||||
See also: https://wiki.lazarus.freepascal.org/FPC_modified_LGPL
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
TMapScalePlugin
|
||||
---------------
|
||||
|
||||
The TMapScalePlugin draws a scale bar in the map to indicate the current
|
||||
zoom magnification. The scale bar is labeled by its length in real-world units.
|
||||
|
||||
Note that due to the projection of the earth onto a plane the magnficiation
|
||||
factor depends on the latitude. In particular at low zoom levels, the
|
||||
magnification can vary between the top and bottom of the displayed map.
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
AlignSet: TScaleAlignSet
|
||||
a set of alignment values (alLeft, alTop, alRight, alBottom) determining the
|
||||
map edge at which the scale bar is positioned.
|
||||
Including both alLeft and alTop centers the bar horizontally,
|
||||
including alTop and alBottom centers it vertically.
|
||||
|
||||
Imperial: Boolean
|
||||
Allows to switch between metric (km, m) and imperial (miles, feet) length
|
||||
units
|
||||
|
||||
SpaceX: Integer
|
||||
Distance of the scale bar from the left or right side of the map
|
||||
|
||||
SpaceY: Integer
|
||||
Distance of the scale bar from the top or bottom side of the map
|
||||
|
||||
WidthMax: Integer
|
||||
Determines the maximum width of the scale bar. The width, however, usually
|
||||
is reduced so that the length label has a "nice" value.
|
||||
|
||||
ZoomMin: Integer
|
||||
Mininum zoom level at which or above which the scale bar is displayed. When
|
||||
the current zoom level is smaller than this limit the bar is hidden because
|
||||
the magnfication varies noticeably across the latitudes shown in the map
|
||||
due to the map projection
|
||||
|
||||
BackgroundColor: TColor
|
||||
Background color of the scale bar. The background is transparent for the
|
||||
color clNone, or when the BackgroundOpacity is 0
|
||||
|
||||
BackgroundOpacity: single
|
||||
Determines the transparency of the background of the scale bar.
|
||||
The value can range between 0 (fully transparent) and 1 (fully opaque).
|
||||
|
||||
Font: TFont
|
||||
Determines the font used for the length label of the scale bar
|
||||
|
||||
Pen: TPen
|
||||
Determines the color, width and style of the scale bar line
|
||||
-------------------------------------------------------------------------------}
|
||||
|
||||
unit mvMapScalePlugin;
|
||||
|
||||
|
@ -42,7 +42,7 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
function EncodeURLElement(const s: String): String; override;
|
||||
procedure SetProxy(AUseSystemProxy, AUseProxy: Boolean; AProxyHost: String;
|
||||
procedure SetProxy({%H-}AUseSystemProxy, AUseProxy: Boolean; AProxyHost: String;
|
||||
AProxyPort: Word; AProxyUserName, AProxyPassword: String); override;
|
||||
{$IF FPC_FullVersion >= 30101}
|
||||
published
|
||||
|
@ -384,7 +384,6 @@ end;
|
||||
function DMSToDeg(Deg, Min: Integer; Sec: Double): Double;
|
||||
var
|
||||
isNeg: Boolean;
|
||||
sgn: Integer;
|
||||
begin
|
||||
isNeg := Deg < 0;
|
||||
Result := abs(Deg) + Min/60.0 + Sec/3600.0;
|
||||
|
@ -520,7 +520,7 @@ type
|
||||
X, Y: Integer): Boolean; virtual;
|
||||
function MouseEnter(AMapView: TMapView): Boolean; virtual;
|
||||
function MouseLeave(AMapView: TMapView): Boolean; virtual;
|
||||
function MouseMove(AMapView: TMapView; AShift: TShiftState; X,Y: Integer): Boolean; virtual;
|
||||
function MouseMove(AMapView: TMapView; {%H-}AShift: TShiftState; {%H-}X,{%H-}Y: Integer): Boolean; virtual;
|
||||
function MouseUp(AMapView: TMapView; AButton: TMouseButton; AShift: TShiftState;
|
||||
X, Y: Integer): Boolean; virtual;
|
||||
function MouseWheel(AMapView: TMapView; AShift: TShiftState; AWheelDelta: Integer;
|
||||
@ -657,7 +657,7 @@ type
|
||||
procedure DoCenterMove(Sender: TObject);
|
||||
procedure DoCenterMoving(Sender: TObject; var NewCenter: TRealPoint; var Allow: Boolean);
|
||||
procedure DoDrawMissingTile(ATileID: TTileID; ARect: TRect);
|
||||
procedure DoDrawPoint(const Area: TRealArea; APt: TGPSPoint);
|
||||
procedure DoDrawPoint(const {%H-}Area: TRealArea; APt: TGPSPoint);
|
||||
procedure DoDrawStretchedTile(const TileId: TTileID; X, Y: Integer; TileImg: TPictureCacheItem; const R: TRect);
|
||||
procedure DoDrawTile(const TileId: TTileId; X,Y: integer; TileImg: TPictureCacheItem);
|
||||
procedure DoDrawTileInfo(const {%H-}TileID: TTileID; X,Y: Integer); deprecated 'Use plugin';
|
||||
@ -909,7 +909,7 @@ type
|
||||
procedure SetCursorShape(AValue: TCursor);
|
||||
function GetHasSelection: Boolean;
|
||||
|
||||
procedure FPOObservedChanged(ASender: TObject;
|
||||
procedure FPOObservedChanged({%H-}ASender: TObject;
|
||||
Operation: TFPObservedOperation; Data: Pointer);
|
||||
procedure ObserveItemColl(AItem: TObject);
|
||||
|
||||
@ -1007,7 +1007,6 @@ implementation
|
||||
uses
|
||||
FileUtil, LazLoggerBase, Math,
|
||||
mvJobQueue,
|
||||
mvDLEFPC,
|
||||
{$IFDEF MSWINDOWS}
|
||||
mvDLEWin,
|
||||
{$ENDIF}
|
||||
|
Loading…
Reference in New Issue
Block a user