Class TTilesProvider

Unit

Declaration

type TTilesProvider = class(TObject)

Description

Abstract base class for tile image provider. Real implementations must inherit from it, assign properties and override methods.
Note to implementors: take any of the existing implementations as base. Try to store all constants within the class declaration leaving no magic values in implementation. This way all values won't be scattered between methods and will be easy to modify.

Hierarchy

Overview

Fields

Public TilesCopyright: string;
Public TileURLPatt: string;
Public APIKey: string;

Methods

Public constructor Create; virtual; abstract;
Public class function Name: string; virtual; abstract;
Public function StorageID: string; virtual;
Public function GetTileURL(const Tile: TTile): string; virtual; abstract;
Public function Clone: TTilesProvider; virtual;

Properties

Public property Features: TTileProviderFeatures read FFeatures;
Public property MinZoomLevel: TMapZoomLevel read FMinZoomLevel;
Public property MaxZoomLevel: TMapZoomLevel read FMaxZoomLevel;
Public property RequiredProperties: TRequiredProperties read FRequiredProperties;
Public property Properties[const Index: string]: string read GetProperty write SetProperty;

Description

Fields

Public TilesCopyright: string;

[opt] Tile copyright that will be painted in the corner of the map. Gets default value when instance is created.

Public TileURLPatt: string;

Pattern of tile URL. For format see FormatTileURL. Gets default value when instance is created, unlikely needed to modify

Public APIKey: string;

[opt] API key for requesting tiles

Methods

Public constructor Create; virtual; abstract;

This item has no description.

Public class function Name: string; virtual; abstract;

Function to return displayable provider name. Name could be used for selection in UI, file paths etc. There's no special limitations on the format of this string so when using it for something other than simple display, the value probably must be validated/preprocessed. The only recommendation is to keep the name short.

Public function StorageID: string; virtual;

Function to return current provider's ID for storage. It could depend on current values of properties (f.ex., streets/satellite). There's no special limitations on the format of this string so when using it for storage, the value probably must be validated/preprocessed. The only recommendation is to keep the name short. By default returns result of Name method.

Public function GetTileURL(const Tile: TTile): string; virtual; abstract;

Method to get URL of specified tile. Uses TileURLPatt

Public function Clone: TTilesProvider; virtual;

Create clone of provider instance copying all data.

Properties

Public property Features: TTileProviderFeatures read FFeatures;

Provider features / capabilities / requirements

Public property MinZoomLevel: TMapZoomLevel read FMinZoomLevel;

Minimal zoom level. Usually 0

Public property MaxZoomLevel: TMapZoomLevel read FMaxZoomLevel;

Maximal zoom level

Public property RequiredProperties: TRequiredProperties read FRequiredProperties;

Set of available required properties. Provided for end user to choose. App is responsible for assigning chosen values to Properties.

Public property Properties[const Index: string]: string read GetProperty write SetProperty;

Generic storage for provider-specific properties. Raises exception in base class, should be implemented in descendants


Generated by PasDoc 0.16.0.