The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



AddLandMark


Unit:SDL_geomap
Class:TGeoMap
Declaration: [1] procedure AddLandMark (Lat, Long, Altitude: double; Element: TLandMarkElement; ClassFlag: byte; Identifier: TLMIdentifier; Time: TDateTime; Tag: longint; ColorFG, ColorBG: TColor; Size: integer; Transparent: boolean; Direction, Length: integer);
[2] procedure AddLandMark (Lat, Long, Altitude: double);
[3] procedure AddLandMark (Lat, Long, Altitude: double; Identifier: TLMIdentifier; Time: TDateTime);
[4] procedure AddLandMark (Lat, Long, Altitude: double; CaptionText: string; CaptionSize: integer; CaptionColor: TColor);
[5] procedure AddLandMark (Lat, Long, Altitude: double; Identifier: TLMIdentifier; Time: TDateTime; CaptionText: string; CaptionSize: integer; CaptionColor: TColor);

The method AddLandmark adds a landmark to the map. It can be used in five different incarnations: [1] using the full specification of a landmark, [2] setting only its position and altitude while using the property LandmarkDefault as a template for the rest of the parameters, and [3] setting the position, the altitude, the identifier and the time stamp of the landmark (all other parameters are taken from LandmarkDefault. Versions [4] and [5] are comparable to versions [2] and [3] but additionally allow to specify the text of a caption and its size and color.

The parameters Lat, Long and Altitude specify the latitude, the longitude and the altitude of the landmark, respectively. The parameter Classflag contains a class number which can be used to group landmarks (i.e. landmarks can be hidden and made visible according to their class number by using the property LMClassVisible). The parameter Identifier is a short string which can be used to identify the landmark, the parameter Time contains the time stamp of the landmark.

The parameter Tag can be used to specify an arbitrary integer value, which can be used by the programmer for his own purposes. Tag is not used by TGeoMap. ColorFG and ColorBG specify the foreground and background color of the landmark. The parameter Size controls the size of the landmark (in pixels). The landmark is transparent if the parameter Transparent is TRUE. In this case the background color ColorBG is ignored.

The parameter Element controls the visual type of the landmark. Currently the following types of landmarks are available:

Finally, the parameters Direction and Length control the direction of arrow and triangle landmarks and the length of arrow landmarks. They are ignored for all other types of landmarks.

Hint: When adding many Landmarks at once, you should turn off automatic redrawing of the map by setting the property SuppressPaint to a TRUE value before starting to add the landmarks. This will speed up things considerably. Following is a small code snippet showing how to quickly draw 100 landmarks:
GeoMap1.SuppressPaint:= true;       // turn off repainting
for i:=1 to 100 do                  // add landmarks
  Geomap1.AddLandMark(LMPos[i].Lat, LMPos[i].Long, 0);
GeoMap1.SuppressPaint:= false;      // turn on repainting

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): simplegeomap



Last Update: 2023-Dec-13