GMap.MapPanTo(GMap.MapOptions.DefaultLatitude,GMap.MapOptions.DefaultLongitude);
GMap.MapOptions.ZoomMap:=2;
if not Query.IsEmpty then
begin
while not Query.EOF do
begin
if LastCountry<>Query.FieldByName('Country').AsString then
begin
GMap.Clusters.Add;
GMap.Clusters[GMap.Clusters.Count-1].Cluster.MinimumClusterSize:=1;
GMap.Clusters[GMap.Clusters.Count-1].Cluster.Title:=Query.FieldByName('Country').AsString;
LastCountry:=Query.FieldByName('Country').AsString;
end;
Marker:=GMap.Markers.Add;
Marker.Latitude:=Query.FieldByName('Latitude').AsFloat;
Marker.Longitude:=Query.FieldByName('Longitude').AsFloat;
Marker.Cluster:=GMap.Clusters[GMap.Clusters.Count-1].Cluster;
Query.Next;
end;
end;
for I:=0 to GMap.Clusters.Count-1 do
GMap.CreateMapCluster(GMap.Clusters.Cluster);