0

i'm working with gmlib (1.5.3, XE10) and tried to use TGeometry.interpolate function but always returns 0.00,0.00. I browse the code an I note that the function interpolate at GMFunctions.pas is empty??

Regards

Ramiro
  • 11
  • 3

1 Answers1

0

wow! So sorry!!

Try with this code! (not tested)

class procedure TGeometry.Interpolate(Map: TCustomGMMap; Origin, Dest: TLatLng;
  Fraction: Real; Result: TLatLng);
const
  StrParams = '%s,%s,%s,%s,%s';
var
  Params: string;
begin
  if not Assigned(Result) then Exit;

  Params := Format(StrParams, [
                Origin.LatToStr(Map.Precision),
                Origin.LngToStr(Map.Precision),
                Dest.LatToStr(Map.Precision),
                Dest.LngToStr(Map.Precision),
                StringReplace(FloatToStr(Fraction), ',', '.', [rfReplaceAll])
              ]);
  THackMap(Map).ExecuteScript('Interpolate', Params);
  Result.Lat := Result.StringToReal(THackMap(Map).FWC.GetStringField(GeometryForm, GeometryFormInterLat));
  Result.Lng := Result.StringToReal(THackMap(Map).FWC.GetStringField(GeometryForm, GeometryFormInterLng));
end;

Please give me a feedback. Thanks!

cadetill
  • 1,552
  • 16
  • 24