Skip to main content
Table of Contents

TTMSFNCOpenLayers.HeatMaps Property

Provides the heat map collection.

API unit family: TMSFNCOpenLayers Declaring type: TTMSFNCOpenLayers Inherited from: TTMSFNCCustomOpenLayers Type: TTMSFNCOpenLayersHeatMaps

Syntax

FMX.TMSFNCOpenLayers.hppPascalC++
property HeatMaps: TTMSFNCOpenLayersHeatMaps;
__property TTMSFNCOpenLayersHeatMaps* HeatMaps = {read=GetHeatMaps, write=SetHeatMaps};

Usage examples

Add an OpenLayers heat map with labels

Populates HeatMaps weighted coordinates and adds a Labels collection item.

Add an OpenLayers heat map with labelsPascalC++
procedure TForm1.ConfigureOpenLayersHeatMapAndLabels;
var
  LHeatMap: TTMSFNCOpenLayersHeatMap;
  LWeightedCoordinate: TTMSFNCMapsWeightedCoordinate;
  LLabel: TTMSFNCMapsLabel;
begin
  TMSFNCOpenLayers1.HeatMaps.Clear;
  TMSFNCOpenLayers1.Labels.Clear;

  LHeatMap := TMSFNCOpenLayers1.HeatMaps.Add;
  LHeatMap.Opacity := 0.6;
  LHeatMap.GradientStartColor := gcGreen;
  LHeatMap.GradientMidColor := gcYellow;
  LHeatMap.GradientEndColor := gcRed;

  LWeightedCoordinate := LHeatMap.WeightedCoordinates.Add;
  LWeightedCoordinate.Coordinate.Latitude := 48.8566;
  LWeightedCoordinate.Coordinate.Longitude := 2.3522;
  LWeightedCoordinate.Weight := 0.9;

  LWeightedCoordinate := LHeatMap.WeightedCoordinates.Add;
  LWeightedCoordinate.Coordinate.Latitude := 50.8503;
  LWeightedCoordinate.Coordinate.Longitude := 4.3517;
  LWeightedCoordinate.Weight := 0.6;

  LLabel := TMSFNCOpenLayers1.Labels.Add;
  LLabel.Coordinate.Latitude := 48.8566;
  LLabel.Coordinate.Longitude := 2.3522;
  LLabel.Text := 'High demand';
  LLabel.BackgroundColor := gcWhite;
  LLabel.BorderColor := gcDodgerblue;
end;
void __fastcall TForm1::ConfigureOpenLayersHeatMapAndLabels()
{
  TMSFNCOpenLayers1->HeatMaps->Clear();
  TMSFNCOpenLayers1->Labels->Clear();

  TTMSFNCOpenLayersHeatMap *LHeatMap = TMSFNCOpenLayers1->HeatMaps->Add();
  LHeatMap->Opacity = 0.6;
  LHeatMap->GradientStartColor = gcGreen;
  LHeatMap->GradientMidColor = gcYellow;
  LHeatMap->GradientEndColor = gcRed;

  TTMSFNCMapsWeightedCoordinate *LWeightedCoordinate = LHeatMap->WeightedCoordinates->Add();
  LWeightedCoordinate->Coordinate->Latitude = 48.8566;
  LWeightedCoordinate->Coordinate->Longitude = 2.3522;
  LWeightedCoordinate->Weight = 0.9;

  LWeightedCoordinate = LHeatMap->WeightedCoordinates->Add();
  LWeightedCoordinate->Coordinate->Latitude = 50.8503;
  LWeightedCoordinate->Coordinate->Longitude = 4.3517;
  LWeightedCoordinate->Weight = 0.6;

  TTMSFNCMapsLabel *LLabel = TMSFNCOpenLayers1->Labels->Add();
  LLabel->Coordinate->Latitude = 48.8566;
  LLabel->Coordinate->Longitude = 2.3522;
  LLabel->Text = "High demand";
  LLabel->BackgroundColor = gcWhite;
  LLabel->BorderColor = gcDodgerblue;
}

Read the related guide