Stelife Map Forum

General Category => General Discussion => Topic started by: support on February 29, 2012, 04:55:51 AM



Title: Manual for StelMap
Post by: support on February 29, 2012, 04:55:51 AM
Class TStelMap:
Offline: Boolean - online / offline download tiles. When offline = TRUE tiles are loaded from the directory CachePath
ShowSet: Boolean - mapping "tools" navigation: zoom, scroll
CachePath: string - path to the directory containing the downloaded tiles
TypeMap: TStyleMap - source type - OpenStreetMap
SiteOSM: string - Address of the server map. You can specify the local address of your server.

procedure LoadMap(LatMap: Double = 0; LonMap: Double = 0) - Loading map by LAT, LON
function AddLayer(): TLayer - Adding new layer on the map
procedure DelLayer(index: integer) - Delete layer from map
procedure ZoomIn() - Zoom in the map
procedure ZoomOut() - Zoom out the map
procedure ZoomInPos(LAT, LON: Double) - Zoom in the map at LAT,LON position
procedure ZoomOutPos(LAT, LON: Double) - Zoom out the map at LAT,LON position

Set of procedures for movement of map:
ShiftUp, ShiftDown, ShiftLeft, ShiftRight

procedure ReDraw() - Redraw the map
procedure Prepare()  - Prepare map canvas
procedure MapResize() - Resize map canvas

constructor Create(AOwner: TComponent); override;
destructor Destroy(); override;

OnCustomDraw - the event for custom draw object on the map
OnBeginMapLoad - event at the beginning of the map is loaded
OnEndMapLoad - event at the end of the map is loaded
OnMapLoad - event for loading of the map
OnMapMouseClick - event mouse click on the map
OnMapMouseMove - event mouse move on the map

Properties to support downloading tiles through a proxy server:
proxyserver, proxyuser, proxypassword: String - the name of the proxy server, user, password
proxyuse, proxyauth: Boolean - flag using a proxy and authentication on proxy server
proxyport: smallint - port of the proxy server
License Properties:
Code: string - the license code received when purchasing
Key: string - the license key received when purchasing
      
Class TLayer:
LayerIndex: smallint - number of layers, starting with 0;
BitMapList: TList - list of images on the map;
ShapeList: TList - list of shapes on the map;
procedure ClearLayer - cleaning the layer;
function AddBitmap(LAT, LON: Double; Hint: string; ShowHint: Boolean; offset_x: integer = 0; offset_y: integer = 0): TBMPObject - add new image on the map
function AddShape(Points: TArrayLatLon; width: smallint; color: TColor; PenStyle: TPenStyle): TShapeObject - add new shape on the map
Visible: Boolean - controls the visibility of the layer

Class TBMPObject
BitMap: TBitMap - bitmap of your image
LatLon: TLATLON - LAT, LON coordinates of your image
Hint: string - hint above your images
ShowHint: Boolean
Visible: Boolean
constructor Create(M: TStelMap)
destructor Destroy(); override
function GPSWidth: Double - return width in geocoorinates of your images
function GPSHeight: Double - return height in geocoorinates of your images

Class TShapeObject
Points: TArrayLatLon - array of point for shape
width: smallint - width lines of shape
color: TColor - color of shape
PenStyle: TPenStyle - pen style of shape
Visible: Boolean
constructor Create(M: TStelMap)
destructor Destroy(); override




Title: Example for StelMap
Post by: support on February 29, 2012, 05:32:34 AM
Draw image on the map
Code:
var
  Car : TBMPObject;
begin
  Car := StelMap1.Layers(0).AddBitmap(MoscowLAT, MoscowLON, 'Car', True, 0, 0);
  Car.BitMap.LoadFromFile('car.bmp');
  StelMap1.ReDraw;
end


Title: Example for StelMap
Post by: support on February 29, 2012, 05:33:50 AM
Draw shape (path) on the map
Code:
var
  Points : TArrayLatLon;
begin
  SetLength(Points, 6);
  Points[0].LAT := MoscowLAT; Points[0].LON := MoscowLON;
  Points[1].LAT := MoscowLAT-1; Points[1].LON := MoscowLON;
  Points[2].LAT := MoscowLAT; Points[2].LON := MoscowLON-1;
  Points[3].LAT := MoscowLAT; Points[3].LON := MoscowLON+1;
  Points[4].LAT := MoscowLAT+1; Points[4].LON := MoscowLON;
  Points[5].LAT := MoscowLAT; Points[5].LON := MoscowLON;
  StelMap1.Layers(0).AddShape(Points, 2, clRed, psSolid);
  StelMap1.ReDraw;
end