Hello there,
I am converting my WebGMaps to FNCMaps. I have some polygons that are editable that I want to store in my DB.
Somehow the polygons need to be updated before reading the new positions. With webGMaps I did that by the following line:
WebGMaps1.GetModifiedMapPolygon(WebGMaps1.Polygons[0].Polygon);
There are some examples of updating rectangles in the documentation.
procedure TForm1.TMSFNCGoogleMaps1PolyElementEditEnd(Sender: TObject;
AEventData: TTMSFNCMapsEventData);
begin
if assigned (AEventData.PolyElement) then
begin
if (AEventData.PolyElement is TTMSFNCGoogleMapsRectangle) then
(AEventData.PolyElement as TTMSFNCGoogleMapsRectangle).Bounds.JSON:= AEventData.CustomData;
end;
end;
So in my logic I made it like this for the polygons but as you guessed it doesn't work.
procedure TfrmZone2.MapsPolyElementEditEnd(Sender: TObject; AEventData: TTMSFNCMapsEventData);
begin
if Assigned(AEventData.PolyElement) then
begin
if (AEventData.PolyElement is TTMSFNCGoogleMapsPolygon) then
begin
(AEventData.PolyElement as TTMSFNCGoogleMapsPolygon).Coordinates.JSON := AEventData.CustomData;
end;
end;
end;
What is the correct way?
Thanks in advance!