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

BoundsRetrieved not firing

 Post Reply Post Reply
Author
Parra Alejandro Romero View Drop Down
Member
Member
Avatar

Joined: 25 Oct 2014
Posts: 64
Post Options Post Options   Quote Parra Alejandro Romero Quote  Post ReplyReply Direct Link To This Post Topic: BoundsRetrieved not firing
    Posted: 25 May 2017 at 5:59pm
Hello

I use the next code

------------------
procedure XXXXX.MapaGPSBoundsRetrieved(Sender: TObject; Bounds: TBounds);
Var
     LatitudCentral, LongitudCentral: Double;
begin
     LatitudCentral := (Bounds.NorthEast.Latitude + Bounds.SouthWest.Latitude) / 2;
     LongitudCentral := (Bounds.NorthEast.Longitude + Bounds.SouthWest.Longitude) / 2;

     ValorLatitudViaje := LatitudCentral;
     ValorLongitudViaje := LongitudCentral;

     Label1.Text := 'Lat: ' + FloattoStr(ValorLatitudViaje) + ' Long: ' + FloattoStr(ValorLongitudViaje);
end;
------------------


However the event is not firing because when I move the map with my fingers the "label1.text" never refresh the new coordinates.

Can you help me please?
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2085
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2017 at 9:08am
Hi,

Please note that the OnBoundsRetrieved event is not triggered automatically.
You can use the GetMapBounds call to trigger the OnBoundsRetrieved event.

To detect when the map has been moved you can use the OnMapMoveEnd event.
Back to Top
Parra Alejandro Romero View Drop Down
Member
Member
Avatar

Joined: 25 Oct 2014
Posts: 64
Post Options Post Options   Quote Parra Alejandro Romero Quote  Post ReplyReply Direct Link To This Post Posted: 02 Jun 2017 at 6:15pm
Originally posted by Bart Holvoet

Hi,

Please note that the OnBoundsRetrieved event is not triggered automatically.
You can use the GetMapBounds call to trigger the OnBoundsRetrieved event.

To detect when the map has been moved you can use the OnMapMoveEnd event.

Hello you have right.

It works now.

However I have another new problem, I can't get the exact center position of the map with OnBoundsRetrieved event, this is because the user can zoom ir or out the maps, and the coordinates LAT and LON are variable.

Check the image below.



Is there a way to get the CENTER position of the map in LATITUDE and LONGITUDE without any exception?

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

Joined: 18 May 2010
Posts: 2085
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jun 2017 at 8:44am
You can get the current center position of the map through the MapOptions.DefualtLatitude and MapOptions.DefaultLongitude properties.
Back to Top
Parra Alejandro Romero View Drop Down
Member
Member
Avatar

Joined: 25 Oct 2014
Posts: 64
Post Options Post Options   Quote Parra Alejandro Romero Quote  Post ReplyReply Direct Link To This Post Posted: 06 Jun 2017 at 10:32pm
Originally posted by Bart Holvoet

You can get the current center position of the map through the MapOptions.DefualtLatitude and MapOptions.DefaultLongitude properties.

Bart

The MapOptions.DefualtLatitude and MapOptions.DefaultLongitude properties content the center position in the map ALWAYS??? even if the user move the map and scroll to another place???
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2085
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jun 2017 at 8:56am
Yes, the properties are updated automatically after the map has moved.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down