Class TMapControl
Unit
Declaration
type TMapControl = class(TScrollBox)
Description
Control displaying a map or its visible part.
Hierarchy
- TScrollBox
- TMapControl
Overview
Fields
MapMarkGlyphStyle: TMapMarkGlyphStyle; |
|
MapMarkCaptionStyle: TMapMarkCaptionStyle; |
|
MapMarkCaptionFont: TFont; |
|
SelectionShiftState: TShiftState; |
|
DragShiftState: TShiftState; |
Methods
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure RefreshTile(TileHorzNum, TileVertNum: Cardinal); |
|
function MapToGeoCoords(const MapPt: TPoint): TGeoPoint; overload; |
|
function MapToGeoCoords(const MapRect: TRect): TGeoRect; overload; |
|
function GeoCoordsToMap(const GeoCoords: TGeoPoint): TPoint; overload; |
|
function GeoCoordsToMap(const GeoRect: TGeoRect): TRect; overload; |
|
function ViewToMap(const ViewPt: TPoint): TPoint; overload; |
|
function ViewToMap(const ViewRect: TRect): TRect; overload; |
|
function MapToView(const MapPt: TPoint): TPoint; overload; |
|
function MapToView(const MapRect: TRect): TRect; overload; |
|
function MapToCanvas(const MapPt: TPoint; Canvas: TCanvas): TPoint; overload; |
|
function MapToCanvas(const MapRect: TRect; Canvas: TCanvas): TRect; overload; |
|
procedure ScrollMapBy(DeltaHorz, DeltaVert: Integer); |
|
procedure ScrollMapTo(Horz, Vert: Integer); |
|
procedure SetZoom(Value: Integer; const MapBindPt: TPoint); overload; |
|
procedure SetZoom(Value: Integer); overload; |
|
procedure ZoomToArea(const GeoRect: TGeoRect); |
|
procedure ZoomToFit; |
|
function MapMarkVisible(MapMark: TMapMark): Boolean; inline; |
|
function MapMarkAtPos(const MapPt: TPoint): TMapMark; |
|
procedure SetCacheImageProperties(TilesHorz, TilesVert, MarginSize: Cardinal); |
|
function SaveToBitmap(const SaveRect: TRect; DrawOptions: TMapOptions; DrawMapMarks: Boolean): TBitmap; overload; |
|
function SaveToBitmap(DrawOptions: TMapOptions; DrawMapMarks: Boolean): TBitmap; overload; |
Properties
property TilesProvider: TTilesProvider read FTilesProvider write SetTilesProvider; |
|
property Zoom: Integer read FZoom; |
|
property MapOptions: TMapOptions read FMapOptions write FMapOptions; |
|
property CenterPoint: TGeoPoint read GetCenterPoint write SetCenterPoint; |
|
property NWPoint: TGeoPoint read GetNWPoint write SetNWPoint; |
|
property MinZoom: TMapZoomLevel index 0 read FMinZoom write SetZoomConstraint; |
|
property MaxZoom: TMapZoomLevel index 1 read FMaxZoom write SetZoomConstraint; |
|
property MapMarks: TMapMarkList read FMapMarkList; |
|
property Tracks: TTrackList read FTracks; |
|
property MouseMode: TMapMouseMode read FMouseMode write SetMouseMode; |
|
property LabelMargin: Cardinal read FLabelMargin write SetLabelMargin; |
|
property ViewRect: TRect read ViewAreaRect; |
|
property VisibleLayers: TMapLayers read FVisibleLayers write SetVisibleLayers; |
|
property OnGetTile: TOnGetTile read FOnGetTile write FOnGetTile; |
|
property OnDrawTile: TOnDrawTile read FOnDrawTile write FOnDrawTile; |
|
property OnDrawTileLoading: TOnDrawTile read FOnDrawTileLoading write FOnDrawTileLoading; |
|
property OnZoomChanged: TNotifyEvent read FOnZoomChanged write FOnZoomChanged; |
|
property OnDrawMapMark: TOnDrawMapMark read FOnDrawMapMark write FOnDrawMapMark; |
|
property OnDrawMapMarkGlyph: TOnDrawMapMark read FOnDrawMapMarkGlyph write FOnDrawMapMarkGlyph; |
|
property OnDrawLayer: TOnDrawLayer read FOnDrawLayer write FOnDrawLayer; |
|
property OnSelectionBox: TOnSelectionBox read FOnSelectionBox write FOnSelectionBox; |
|
property OnMapMarkMouseDown: TOnMapMarkMouseButtonEvent read FOnMapMarkMouseDown write FOnMapMarkMouseDown; |
|
property OnMapMarkMouseUp: TOnMapMarkMouseButtonEvent read FOnMapMarkMouseUp write FOnMapMarkMouseUp; |
Description
Fields
MapMarkGlyphStyle: TMapMarkGlyphStyle; |
|
Default glyph style of mapmarks. New items will be init-ed with this value |
MapMarkCaptionStyle: TMapMarkCaptionStyle; |
|
Default caption style of mapmarks. New items will be init-ed with this value |
MapMarkCaptionFont: TFont; |
|
Default font of mapmarks. New items will be init-ed with this value |
Methods
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure RefreshTile(TileHorzNum, TileVertNum: Cardinal); |
|
(Re)draw single tile having numbers |
function MapToGeoCoords(const MapPt: TPoint): TGeoPoint; overload; |
|
Convert a point from map pixel coords to geo coords |
function MapToGeoCoords(const MapRect: TRect): TGeoRect; overload; |
|
Convert a rect from map pixel coords to geo coords |
function GeoCoordsToMap(const GeoCoords: TGeoPoint): TPoint; overload; |
|
Convert a point from geo coords to map pixel coords |
function GeoCoordsToMap(const GeoRect: TGeoRect): TRect; overload; |
|
Convert a rect from geo coords to map pixel coords |
function ViewToMap(const ViewPt: TPoint): TPoint; overload; |
|
Convert a point from view area coords to map coords |
function ViewToMap(const ViewRect: TRect): TRect; overload; |
|
Convert a rect from view area coords to map coords |
function MapToView(const MapPt: TPoint): TPoint; overload; |
|
Convert a point from map coords to view area coords |
function MapToView(const MapRect: TRect): TRect; overload; |
|
Convert a rect from map coords to view area coords |
function MapToCanvas(const MapRect: TRect; Canvas: TCanvas): TRect; overload; |
|
Convert a rect from map coords to view area's canvas coords |
procedure ScrollMapBy(DeltaHorz, DeltaVert: Integer); |
|
Delta move the view area |
procedure ScrollMapTo(Horz, Vert: Integer); |
|
Absolutely move the view area |
procedure SetZoom(Value: Integer); overload; |
|
Simple zoom change with binding to top-left corner |
procedure ZoomToArea(const GeoRect: TGeoRect); |
|
Zoom to show given region |
procedure ZoomToFit; |
|
Zoom to fill view area as much as possible |
function MapMarkVisible(MapMark: TMapMark): Boolean; inline; |
|
Returns mapmark visibility based on mapmark's own property and also on currently selected visible layers of the map |
function MapMarkAtPos(const MapPt: TPoint): TMapMark; |
|
Returns most recently added visible mapmark located at given map point considering its glyph size. |
function SaveToBitmap(const SaveRect: TRect; DrawOptions: TMapOptions; DrawMapMarks: Boolean): TBitmap; overload; |
|
Export map fragment as bitmap. Parameters
Exceptions raised
|
function SaveToBitmap(DrawOptions: TMapOptions; DrawMapMarks: Boolean): TBitmap; overload; |
|
Export whole map as bitmap. Parameters
Exceptions raised
|
Properties
property TilesProvider: TTilesProvider read FTilesProvider write SetTilesProvider; |
|
Tiles provider object. Assigning this property could change some map properties (zoom range, for example, and hence current zoom) so cache will be cleared and the map will be redrawn with new conditions. |
property Zoom: Integer read FZoom; |
|
Current zoom level |
property MapOptions: TMapOptions read FMapOptions write FMapOptions; |
|
Map options |
property CenterPoint: TGeoPoint read GetCenterPoint write SetCenterPoint; |
|
Point of center of current view area. Set this property to move view. If map is smaller than view area and resulting point falls out of the map, the Eastmost-Southmost (Bottom-right) point is returned and any assigning to this property has no effect. |
property NWPoint: TGeoPoint read GetNWPoint write SetNWPoint; |
|
Point of top-left corner of current view area. Set this property to move view If map is smaller than view area any assigning to this property has no effect. |
property MinZoom: TMapZoomLevel index 0 read FMinZoom write SetZoomConstraint; |
|
Minimal zoom level. Zoom couldn't be set to a value less than this value |
property MaxZoom: TMapZoomLevel index 1 read FMaxZoom write SetZoomConstraint; |
|
Maximal zoom level. Zoom couldn't be set to a value greater than this value |
property MapMarks: TMapMarkList read FMapMarkList; |
|
List of mapmarks on a map. Addition and deletion of items automatically redraws the parent map but to reflect any modifications of item properties call Map.Invalidate manually. |
property Tracks: TTrackList read FTracks; |
|
List of |
property MouseMode: TMapMouseMode read FMouseMode write SetMouseMode; |
|
Mode of handling left mouse button press |
property LabelMargin: Cardinal read FLabelMargin write SetLabelMargin; |
|
Size of margin for labels on map, in pixels |
property ViewRect: TRect read ViewAreaRect; |
|
View area in map coords. Could be larger than the map on low zoom levels |
property VisibleLayers: TMapLayers read FVisibleLayers write SetVisibleLayers; |
|
Set of visible layers. Initially includes all layers. Quickly show/hide all layers with LayersAll and LayersNone constants |
property OnGetTile: TOnGetTile read FOnGetTile write FOnGetTile; |
|
Callback to get an image of a single tile having number ( |
property OnDrawTile: TOnDrawTile read FOnDrawTile write FOnDrawTile; |
|
Callback to draw an image of a single tile having number ( If |
property OnZoomChanged: TNotifyEvent read FOnZoomChanged write FOnZoomChanged; |
|
Called when zoom level is changed |
property OnDrawMapMarkGlyph: TOnDrawMapMark read FOnDrawMapMarkGlyph write FOnDrawMapMarkGlyph; |
|
Callback to custom draw a mapmark's glyph. It is called before default drawing. If |
property OnDrawLayer: TOnDrawLayer read FOnDrawLayer write FOnDrawLayer; |
|
Callback to custom draw a layer of whole map view. It is called for visible layers after drawing tiles and before drawing all objects (mapmarks, tracks, labels) |
property OnSelectionBox: TOnSelectionBox read FOnSelectionBox write FOnSelectionBox; |
|
Called when selection with mouse changes |
property OnMapMarkMouseDown: TOnMapMarkMouseButtonEvent read FOnMapMarkMouseDown write FOnMapMarkMouseDown; |
|
Called when user presses a mouse button above a mapmark |
property OnMapMarkMouseUp: TOnMapMarkMouseButtonEvent read FOnMapMarkMouseUp write FOnMapMarkMouseUp; |
|
Called when user releases a mouse button above a mapmark |
Generated by PasDoc 0.16.0.