Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

TMSFMXWebGMapsReverseGeocoding1 not work in Androi

 Post Reply Post Reply
Author
camacho hilda View Drop Down
New Member
New Member
Avatar

Joined: 09 Feb 2015
Posts: 23
Post Options Post Options   Quote camacho hilda Quote  Post ReplyReply Direct Link To This Post Topic: TMSFMXWebGMapsReverseGeocoding1 not work in Androi
    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;
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2163
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post 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;
Back to Top
camacho hilda View Drop Down
New Member
New Member
Avatar

Joined: 09 Feb 2015
Posts: 23
Post Options Post Options   Quote camacho hilda Quote  Post ReplyReply Direct Link To This Post 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  TMS reccommended Me  TThread.Queue( ,

some idea for fix??


thanks

Back to Top
camacho hilda View Drop Down
New Member
New Member
Avatar

Joined: 09 Feb 2015
Posts: 23
Post Options Post Options   Quote camacho hilda Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2017 at 6:22pm
Android 5.0.1 the code does not work either, some version where the component work?
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2163
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post 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: help@tmssoftware.com
Back to Top
camacho hilda View Drop Down
New Member
New Member
Avatar

Joined: 09 Feb 2015
Posts: 23
Post Options Post Options   Quote camacho hilda Quote  Post ReplyReply Direct Link To This Post Posted: 02 Mar 2017 at 6:14pm
Of course, I sent the problem project

thanks
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2163
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 2017 at 11:50am
This post has been replied to via Email.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down