TTMSFNCMapsHeatMapOptions?? exist?

ChatGPT suggested this to me. Is that correct?

procedure TForm1.Button1Click(Sender: TObject);
var
HeatPoints: TTMSFNCMapsHeatMapArray;
Options: TTMSFNCMapsHeatMapOptions;
begin
// Configura el proveedor del mapa, por ejemplo Google
TMSFNCMaps1.MapOptions.Provider := mpGoogleMaps;
TMSFNCMaps1.APIKey := 'TU_API_KEY';

// Crear puntos de calor
SetLength(HeatPoints, 3);

HeatPoints[0].Latitude := 40.7128;
HeatPoints[0].Longitude := -74.0060;
HeatPoints[0].Weight := 0.5; // peso entre 0.0 y 1.0

HeatPoints[1].Latitude := 40.7138;
HeatPoints[1].Longitude := -74.0065;
HeatPoints[1].Weight := 0.8;

HeatPoints[2].Latitude := 40.7148;
HeatPoints[2].Longitude := -74.0070;
HeatPoints[2].Weight := 1.0;

// Opciones del HeatMap
Options := TTMSFNCMapsHeatMapOptions.Create;
Options.Radius := 20;
Options.Dissipating := True;
Options.Opacity := 0.6;

// Agregar HeatMap
TMSFNCMaps1.AddHeatMap(HeatPoints, Options);
end;

The suggested code is not entirely correct, please have a look at the following blog post for an example on using Heatmaps in TMS FNC Maps:

Hi Bart, thanks! ChatGPT is very creative :slight_smile:

Maybe you can help me with the following case:

I have cars classified as expensive (> U$ 80000), not expensive (U$20000..U$80000), and the cheapest (< U$ 20000). I need to show in a map in which areas the people have expensive, not expensive and cheap cars where the expensive are red and the cheapest are green.

How can I do, using a heatmap, to view this information? Can I use the Weight for that?

Kind regards,

Diego

Hi Diego,

A heatmap displays the density of the data points in a region not the type of data.
You could indeed try assigning a higher weight value to data points for expensive cars, but if there are areas with a very high amount of cheap cars these might be displayed in red as well.