Print Page | Close Window

TMSFMXWebGMapsReverseGeocoding1 not work in Androi

Printed From: TMS Software
Category: FMX Components
Forum Name: FMX WebGMaps / WebOSMaps
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=7549
Printed Date: 29 Mar 2020 at 10:27pm


Topic: TMSFMXWebGMapsReverseGeocoding1 not work in Androi
Posted By: camacho hilda
Subject: TMSFMXWebGMapsReverseGeocoding1 not work in Androi
Date Posted: 28 Feb 2017 at 6:11pm
Hi guys , the code below not work in android

Android version 4.4.2
Delphi berlin 10.1 update 2
Tms gmaps  v2.6.1.0 (December 1, 2016)

Error:  raised exception class Illegal instruction (4)

can You help Me?

procedure TForm2.LocationSensor1LocationChanged(Sender: TObject;
  const OldLocation, NewLocation: TLocationCoord2D);
var
  LDecSeparator: String;
begin
  try
    LDecSeparator := FormatSettings.DecimalSeparator;
    FormatSettings.DecimalSeparator := '.';

    if FCurrentPosition.Distance(NewLocation) > Accuracy then
    begin
      FCurrentPosition := NewLocation;
      latmap := NewLocation.Latitude;
      Longmap := NewLocation.Longitude;
      if ((latmap >= -90) and (latmap <= 90)) and
        ((Longmap >= -180) and (Longmap <= 180)) then
      begin
        if TMSFMXWebGmaps1.Markers.Count>0 then
          TMSFMXWebGMaps1.Markers.clear;

        TMSFMXWebGMaps1.MapPanTo(latmap , Longmap);
        TMSFMXWebGMaps1.MapOptions.ZoomMap:=18;

        TMSFMXWebGMaps1.Markers.Add(latmap, Longmap, 'My position', '', false, true, true, true, false, 0);
                
                         {$IFDEF ANDROID}
                           TThread.Queue(nil,
                           procedure
                          var
                                cp, ciudad: String;
                           begin
                              TMSFMXWebGMapsReverseGeocoding1.Latitude := latmap;
                              TMSFMXWebGMapsReverseGeocoding1.Longitude := Longmap;
                              TMSFMXWebGMapsReverseGeocoding1.LaunchReverseGeocoding; <--------Exception

                               cp := TMSFMXWebGMapsReverseGeocoding1.ResultAddress.PostalCode;
                               ciudad:=(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.city);

                               Label38.text:='Extra Information for: '+UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.Street) + ' ' +
                               UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.StreetNumber);
                               Label43.text:=UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.Street)+ ' '+UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.StreetNumber)
                               + ' ,'+UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.City)+ ' '+UTF8Decode(TMSFMXWebGMapsReverseGeocoding1.ResultAddress.State);
                           end);
                         {$ENDIF}
      end;
    end;
  finally
    LocationSensor1.Active := False ;
  end;
end;



Replies:
Posted By: Bart Holvoet
Date Posted: 01 Mar 2017 at 9:18am
Hi,

Can you please try changing your code as indicated below?

Example:
    if TMSFMXWebGMapsReverseGeocoding1.LaunchReverseGeocoding = erOk then
    begin 

     cp := TMSFMXWebGMapsReverseGeocoding1.ResultAddress.PostalCode;
     ...

    end;


Posted By: camacho hilda
Date Posted: 01 Mar 2017 at 5:41pm
No, the code does not work either, in this link    http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=7013&title=tmsfmxwebgmapsreversegeocoding-android-sensor - http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=7013&title=tmsfmxwebgmapsreversegeocoding-android-sensor   TMS reccommended Me  TThread.Queue( ,

some idea for fix??


thanks



Posted By: camacho hilda
Date Posted: 01 Mar 2017 at 6:22pm
Android 5.0.1 the code does not work either, some version where the component work?


Posted By: Bart Holvoet
Date Posted: 02 Mar 2017 at 10:59am
I have not been able to reproduce this issue after changing the code as mentioned in my previous post.
Can you please provide a ready to run sample project that demonstrates the issue so I can further investigate this?
Sample projects can be emailed to: mailto:help@tmssoftware.com - help@tmssoftware.com


Posted By: camacho hilda
Date Posted: 02 Mar 2017 at 6:14pm
Of course, I sent the problem project

thanks


Posted By: Bart Holvoet
Date Posted: 06 Mar 2017 at 11:50am
This post has been replied to via Email.



Print Page | Close Window