0

does anyone know how to add text on a markup of mapview component ?

In an application developed with delphi 10.4.2 and using the mapview component I tried to display a text on the marker but without result.

I tried with this code but it doesn't work.

  var
    MapCenter : TMapCoordinate := TMapCoordinate.Create(latitude, longitude);
  var
    desqr : TMapMarkerDescriptor := TMapMarkerDescriptor.Create(MapCenter, 'marker',);
  desqr.Snippet := myVariable; // this does not work
  MapView1.Location := mapCenter;
  desqr.Draggable := True;
  MapView1.AddMarker(desqr);
  MapView1.Zoom := 10;

Thanks in advance.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
  • nothing is displayed on the mapview marker – Kellouche AbdelHakim Sep 20 '21 at 10:23
  • Have you inspected `descr` under the debugger and checcked that it has sensible values for each of its fields (see https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Maps.TMapMarkerDescriptor)? Also you need to add a proper [minimal, reproducible example](https://stackoverflow.com/help/mcve) to your q so that it shows e.g, how `myVaraiable` is declared and initialised - scraps of code as you have now are not sufficient. – MartynA Sep 20 '21 at 10:30
  • I have found the error. I would use Title proprety with an acceptable zoom. – Kellouche AbdelHakim Sep 20 '21 at 11:09

0 Answers0