Groups enable you to manage a set of elements, you can load them, save them, display them, hide them, move them to a single command.
// show group 'group-one'
map.Groups['group-one'].visible := true;
// move group
map.Groups['group-one'].setCenter(43.232951,0.078082);
The elements that you can group are the markers, polylines, polygones, circles, rectangles, groundoverlays and labels
the property Groups[] Returns a TECMapItemGroup, Access groups will create a group if it does not exist.
The groups name is not case sensitive, map.Groups['group'] is equivalent to map.Groups['Group']
46var i:integer;
GLines : TECMapItemGroup;
begin
GLines := map.groups['GLines'];
GLines.BeginUpdate;
GLines.clear;
for i:=0 to map.polylines.count - 1 do
GLines.add(map.Polylines[i]);
for i:=0 to map.polygones.count - 1 do
GLines.add(map.Polygones[i]);
GLines.EndUpdate;
TECMapItemGroup
procedure BeginUpdate;
procedure EndUpdate;
procedure Clear;
procedure Add(const item:TECMapItem);
Removes all the elements of the Group and of the map, the elements no longer exist
If you delete a group by map.Groups['Group'].Free the elements are not removed from the map
47Saves the Group to a text file.
Use the .gpx , .kml and .json to specify a format, otherwise it is the internal format of ECMap that will be used
procedure LoadFromFile(const value: string);
Load the contents of a text file in the internal format of ECMap
Use the .gpx , .kml and .json to specify a format, otherwise it is the internal format of ECMap that will be used
LoadFromFile can download files on internet
48
function Contains(const lat, Lng: double): boolean;
procedure PanToBounds;
procedure fitBounds;
property Visible:boolean ;
property MinZoom:byte ;
property MaxZoom:byte ;
property SouthWestLat: double ;
property SouthWestLng: double ;
property NorthEastLat: double ;
property NorthEastLng: double ;
property CenterLat : double ;
property CenterLng : double ;
property Name : string;
property toGPX : string;Property read/write which gives access to the data of the card in GPX format.
Property in read / write which returns the overlays (all except the Labels) in Kml format
property ToGeoJSON : string
Property in read / write which returns / adds overlays (just the markers, the polylines, polygons, circles, and rectangles) in the GeoJSON format
property ItemsToTxt : string;
Property in read / write which returns / adds overlays in internal text of TECMAP
property Count : integer
property Item[index:integer]:TECMapItem