Custom Marker on Android

The following code works on Windows but not on Android

Yes, LocalFileAccess is True

The image is a .png and is stored at location 'file://' + DocumentsPath(cSmallHouse);

If I do a FileExists( DocumentsPath(cSmallHouse)) on it returns true.

Any ideas.

for NO in FSelectedNearby do
begin
GMM := mapGoogle.Markers.Add;
GMM.Longitude := NO.Longitude;
GMM.Latitude := NO.Latitude;
GMM.IconURL := 'file://' + DocumentsPath(cSmallHouse);

  GMM.AddOverlayView(NO.Marker);
  GMM.Title := NO.OrderID.ToString;

  OV := mapGoogle.AddOverlayView;
  OV.Coordinate.Latitude := NO.Latitude;
  OV.Coordinate.Longitude := NO.Longitude;
  OV.Mode := omCoordinate;
  OV.Text := NO.Overlay;
  OV.Visible := False;

end;

We'll investigate why the file is not being displayed, this could be a security issue on local files in the Android webview. Did you know you can also specify the base64 representation of your marker icon? You can use converters like https://www.base64-image.de/ and then pass the base64 representation string as a value to the IconURL property instead of the file URL.

So it should be a URL and not the LocalFile to test this?

That works.

1 Like