Jump to content

use a Hitamp plugin on the UniMap


Ario.Paxaz

Recommended Posts

If interested:
https://store.falconsistemas.com.br 

Example of an application using the heatmap from the UniFSMap maps component (UniFalcon)

image.thumb.png.8bdfffdeabbb3b33f794fc8bdf1fc901.png

 

Code example for this application:

in the first block the polygons are created
in the second block the heatmap is created based on the points (Lat, Lng)

 

procedure TfrmModManejoPainel.CarregaHMEspecies(ID_FAZENDA, ID_SAFRA, ID_CULTURA,
  ID_TALHAO, ID_ESPECIE: Integer; DAT_INI, DAT_FIM: TDate);
var
  Polygon: TPolygon;
  PointHeatMap: TPointHeatMap;
  ListTalhaoPolygon: TObjectList<TTalhaoPolygon>;
  TalhaoPolygons: TTalhaoPolygons;

  PontoReferencias: TPontoReferencias;
  LstLatLng: TObjectList<TLatLng>;
  vI: Integer;
begin
  TalhaoPolygons := TTalhaoPolygons.Create(dmBanco.Conexao);
  ListTalhaoPolygon := TalhaoPolygons.GetListTalhao(ID_FAZENDA,0);
  try
    for vI := 0 to ListTalhaoPolygon.Count-1 do
    begin
      Polygon := TPolygon.Create;
      Polygon.Id := ListTalhaoPolygon[vI].ID_TALHAO_POLYGON;
      Polygon.Paths := ListTalhaoPolygon[vI].POLYGON;
      Polygon.StrokeColor := '#014FA1';
      Polygon.strokeOpacity := '0.5';
      Polygon.strokeWeight := 2;
      Polygon.fillColor := '#014FA1';
      Polygon.fillOpacity := '0.1';

      map.AddPolygon(Polygon);
    end;
  finally
    FreeAndNil(TalhaoPolygons);
    FreeAndNil(ListTalhaoPolygon);
  end;

  PontoReferencias := TPontoReferencias.Create(dmBanco.Conexao);
  LstLatLng := PontoReferencias.GetListPontosEspecietLng(ID_FAZENDA, ID_SAFRA, ID_CULTURA, ID_TALHAO, ID_ESPECIE, DAT_INI, DAT_FIM);
  try
    for vI := 0 to LstLatLng.Count -1 do
    begin
      PointHeatMap := TPointHeatMap.Create;
      PointHeatMap.Lat := LstLatLng.Items[vI].Lat;
      PointHeatMap.Lng := LstLatLng.Items[vI].Lng;

      map.AddPointHeatMap(PointHeatMap);
    end;

    map.ShowHeatMap;
    map.SetOpacityHeatMap(1);
  finally
    FreeAndNil(PontoReferencias);
    FreeAndNil(LstLatLng);
  end;
end;

 

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...