BoundsRetrieved not firing


I use the next code

procedure XXXXX.MapaGPSBoundsRetrieved(Sender: TObject; Bounds: TBounds);
     LatitudCentral, LongitudCentral: Double;
     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);

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?


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?


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


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???

Yes, the properties are updated automatically after the map has moved.