Unit OSM.MapControl
Description
Visual control displaying a map. Data for the map (tile images) must be supplied via callbacks.
(c) Fr0sT-Brutal https://github.com/Fr0sT-Brutal/Delphi_OSMMap
See also
- OSM.TileStorage
- OSM tile images cache.
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
function ToInnerCoords(const StartPt, Pt: TPoint): TPoint; overload; inline; |
function ToOuterCoords(const StartPt, Pt: TPoint): TPoint; overload; inline; |
function ToInnerCoords(const StartPt: TPoint; const Rect: TRect): TRect; overload; inline; |
function ToOuterCoords(const StartPt: TPoint; const Rect: TRect): TRect; overload; inline; |
procedure Triangle(Canvas: TCanvas; const Rect: TRect); |
function RectByCenterAndSize(const CenterPt: TPoint; Size: Integer): TRect; |
function ShiftStateIs(Current, Desired: TShiftState): Boolean; |
Types
Constants
Description
Functions and Procedures
function ToInnerCoords(const StartPt, Pt: TPoint): TPoint; overload; inline; |
Convert absolute map coords to a point inside a viewport having given top-left point
|
function ToOuterCoords(const StartPt, Pt: TPoint): TPoint; overload; inline; |
Convert a point inside a viewport having given top-left point to absolute map coords
|
function ToInnerCoords(const StartPt: TPoint; const Rect: TRect): TRect; overload; inline; |
Convert absolute map rect to a rect inside a viewport having given top-left point
|
function ToOuterCoords(const StartPt: TPoint; const Rect: TRect): TRect; overload; inline; |
Convert a rect inside a viewport having given top-left point to absolute map rect
|
procedure Triangle(Canvas: TCanvas; const Rect: TRect); |
Draw triangle on canvas
|
function RectByCenterAndSize(const CenterPt: TPoint; Size: Integer): TRect; |
Return rectangle with center point in CenterPt and with size Size
|
function ShiftStateIs(Current, Desired: TShiftState): Boolean; |
Determine whether current ShiftState corresponds to desired one (that is, if mouse button and pressed modifiers are the same - not a simple comparison because TShiftState could include additional entries like "Pen", "Touch" and so on. This function only checks Ctrl, Alt, Shift and Left, Right, Middle mouse buttons.
|
Types
TMapMarkGlyphShape = (...); |
Shape of mapmark glyph
Values
-
gshCircle
-
gshSquare
-
gshTriangle
|
TOpacity = Byte; |
Opacity level, from 0 (transparent) to $FF (non-transparent)
|
TMapMarkCustomProp = (...); |
Flags to indicate which properties must be taken from MapMark object when drawing. By default props will use owner's values
Values
-
propGlyphStyle
-
propCaptionStyle
-
propFont
|
TMapLayer = Byte; |
Number of a layer. 0 means default, base layer.
|
TMapLayers = set of Byte; |
This item has no description. |
TOnItemNotify = procedure (Sender: TObject; Item: T; Action: TListNotification) of object; |
Notification that item is added to the list or removed from it
|
TMapMarkFindOption = (...); |
Options for TMapMarkList.Find. Default is empty set
Values
-
mfoConsiderGlyphSize: If set (for map pixels only): consider mapmark glyph size as well. If not set (default): search by exact coords.
-
mfoOnlyVisible: If set: consider only visible mapmarks. If not set (default), consider all mapmarks
|
TMapOption = (...); |
Options of map control
Values
-
moDontDrawCopyright
-
moDontDrawScale
|
TMapOptions = set of TMapOption; |
This item has no description. |
TMapMouseMode = (...); |
Mode of current handling of mouse events:
Values
-
mmNone: default handling - mouse doesn't activate the map
-
mmDragging: dragging the map
-
mmSelecting: drawing selection box
|
TOnGetTile = function (Sender: TMapControl; TileHorzNum, TileVertNum: Cardinal): TBitmap of object; |
Callback to get an image of a single tile having number (TileHorzNum ;TileVertNum ). Must return bitmap of a tile or Nil if it's not available at the moment
|
TOnDrawTile = procedure (Sender: TMapControl; TileHorzNum, TileVertNum: Cardinal; const TopLeft: TPoint; Canvas: TCanvas; var Handled: Boolean) of object; |
Callback to draw an image of a single tile having number (TileHorzNum ;TileVertNum ) at point TopLeft on canvas Canvas . Must set Handled to True , otherwise default actions will be done. This type is common for both TMapControl.OnDrawTile and TMapControl.OnDrawTileLoading callbacks.
|
TOnDrawMapMark = procedure (Sender: TMapControl; Canvas: TCanvas; const Point: TPoint; MapMark: TMapMark; var Handled: Boolean) of object; |
Callback to custom draw a mapmark or just a glyph with center point Point . It is called before default drawing. If Handled is not set to True , default drawing will be done.
|
TOnDrawLayer = procedure (Sender: TMapControl; Layer: TMapLayer; Canvas: TCanvas; const CanvasRect, MapInViewRect: TRect) of object; |
Callback to custom draw a visible layer of whole map view. CanvasRect is rectangle of current view in canvas coords (use it in paint functions) and MapInViewRect is rectangle of current view in map coords (use it to check visibility of objects).
|
TOnSelectionBox = procedure (Sender: TMapControl; const GeoRect: TGeoRect; Finished: Boolean) of object; |
Callback to react on selection by mouse
|
TOnMapMarkMouseButtonEvent = procedure (Sender: TMapControl; MapMark: TMapMark; Button: TMouseButton; Shift: TShiftState) of object; |
Callback to react on mouse button press/release
|
Constants
DefaultCacheImageTilesHorz = 8; |
Default Width (Horizontal dimension) and Height (Vertical dimension) of cache image in number of tiles. Cache is init-ed with these values but could be changed later. Memory occupation of an image: (4 bytes per pixel) * TilesH * TilesV * (65536 pixels in single tile) For value 8 it counts 16.7 Mb
|
DefaultCacheImageTilesVert = 8; |
This item has no description. |
DefaultCacheMarginSize = 2; |
Default margin that is added to cache image to hold view area, in number of tiles
|
DefaultLabelMargin = 2; |
Default size of margin for labels on map, in pixels
|
DefLineDrawProps: TLineDrawProps = (
Width: 3;
Style: psSolid;
Color: clBlue
); |
Default style of track line.
|
LayersNone: TMapLayers = []; |
Constant containing no layers
|
S_Lbl_Loading = 'Loading [%d : %d]...'; |
Default pattern to draw on currently loading tiles
|
Author
- Fr0sT-Brutal (https://github.com/Fr0sT-Brutal)
Generated by PasDoc 0.16.0.