Problem with updating the bounds values of a TTMSFNCGoogleMapsRectange

I have a problem with updating the bounds values of a TTMSFNCGoogleMapsRectange in TMSFNCGoogleMaps.

At first I draw a rectangle on the TMSFNCGoogleMaps map with defined bounds:

TMSFNCGoogleMaps1.BeginUpdate;
  with TMSFNCGoogleMaps1.Rectangles[0] do
  begin
    Bounds.NorthEast.Latitude := 40.773941;
    Bounds.NorthEast.Longitude := -74.12544;
    Bounds.SouthWest.Latitude := 40.712216;
    Bounds.SouthWest.Longitude := -74.22655;

    Editable := True;
    FillColor := gcOrange;
    FillOpacity := 0.5;
    StrokeColor := gcGreen;
    StrokeWidth := 2;
  end;
TMSFNCGoogleMaps1.EndUpdate;

Then I get the bounds of the Rectangle and display them in Memo1. Currently everything is ok - the read values of bounds displayed in Memo1 are equal to the values defined in the code.

Memo1.Lines.Clear;
Memo1.Lines.Add( 'NorthEast.Latitude:  ' + FloatToStr(TMSFNCGoogleMaps1.Rectangles[0].Bounds.NorthEast.Latitude) );
Memo1.Lines.Add( 'NorthEast.Longitude:  ' + FloatToStr(TMSFNCGoogleMaps1.Rectangles[0].Bounds.NorthEast.Longitude) );
Memo1.Lines.Add('');
Memo1.Lines.Add( 'SouthWest.Latitude:  ' + FloatToStr(TMSFNCGoogleMaps1.Rectangles[0].Bounds.SouthWest.Latitude) );
Memo1.Lines.Add( 'SouthWest.Longitude:  ' + FloatToStr(TMSFNCGoogleMaps1.Rectangles[0].Bounds.SouthWest.Longitude) );

Next I change size of the rectangle (using the mouse) and read the corners of the rectangle again (to update them). Unfortunately, the bounds values are not updated :frowning:.
Please advise me how to get the current bounds values of a TTMSFNCGoogleMapsRectange after editing it - maybe it is necessary to refer directly to a javascript procedure?

Hi,

Can you please have a look at the suggested solution using the OnPolyElementEditEnd event in this thread?

Yes. I tried to use reading bounds in OnPolyElementEditEnd.
Unfortunately the result is the same as I described previously - the current bounds of the TTMSFNCGoogleMapsRectange are not returned :confused:

Thanks for suggestion.
Indeed, data on the current rectangle coordinates are available in AEventData.CustomData - as JSON. I've pasted an example below - maybe someone will find it useful:

procedure TForm1.TMSFNCGoogleMaps1PolyElementEditEnd(Sender: TObject; AEventData: TTMSFNCMapsEventData);
begin
  if Assigned(AEventData.PolyElement) then
  begin
    if (AEventData.PolyElement is TTMSFNCGoogleMapsRectangle) then Memo1.Lines.Add(AEventData.CustomData);
  end;
end;