Can I save and load Polygons[0].JSON for the FNC Google Map?

I am saving JSON which looks nicely formatted for the polygon object of my Google map:

DatabaseFieldValue:= Map.Polygons[0].JSON;

I am hoping there is a similarly easy way to "load" this JSON to show the Polygon on the map.

I tried:

Map.Polygons[0].JSON:= DatabaseFieldValue;

and

var
ss: TStringStream;
begin
TestForPolygonObjectOnMap;
if Value <> '' then
begin
ss:= TStringStream.Create(Value);
ss.Seek(0,0);
Polygons[0].LoadFromJSONStream(ss);
ss.Free;
end
else
Polygons.Clear;

But both seem to need the CoordinateItems which are referenced in the JSON to already exist.

I could parse the JSON and create the Items ... but that seems a lot of work, which I would expect to be built into the component somehow.

What should I be doing?

I ended up using the following code:

procedure TabMap.ParsePolyDataOntoMap(aJSONStr: String);
var
aJSONValue, aCoordJSON: TJSONValue;
jar: TJSONArray;
i: Integer;
j: Integer;
oJSON, oCoord: TJSONObject;
LL: string;
aLatitude: Double;
aLongitude: Double;
begin
aLatitude:= 0;
aLongitude:= 0;
oJson := TJSONObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(aJSONStr),0));
jar := TJSONArray(oJson.Get('Coordinates').JsonValue);
for i := 0 to Pred(jar.Count) do
begin
oCoord := TJSONObject(jar.Items[i]);
for j := 0 to Pred(oCoord.Count) do
begin
//Iterate
if oCoord.Get(j).JsonString.Value = 'Latitude' then
aLatitude:= StrToFloat(oCoord.Get(j).JsonValue.Value);
if oCoord.Get(j).JsonString.Value = 'Longitude' then
aLongitude:= StrToFloat(oCoord.Get(j).JsonValue.Value);
if (aLatitude <> 0) and (aLongitude <> 0) then
begin
AddPolyPoint(aLatitude, aLongitude);
aLatitude:= 0;
aLongitude:= 0;
end;
end;
end;
end;

I am not sure whether this is a sensible way to solve the problem, but it works.

I am a newbie to JSON manipulation ...

This is the "AddPolyPoint" code mentioned above:

procedure TabMap.AddPolyPoint(aLat, aLong: Double);
var
aPoint: TTMSFNCMapsCoordinateItem;
aPolyLine: TTMSFNCGoogleMapsPolygon;
begin
btnSave.Enabled:= true;
TestForPolygonObjectOnMap;
BeginUpdate;
aPolyLine:= Polygons[0];
aPoint:= aPolyLine.Coordinates.Add;
aPoint.Latitude:= aLat;
aPoint.Longitude:= aLong;
//the following lines seem to "bump" the system to actually display the polygon
aPolyLine.Clickable:= NOT aPolyLine.Clickable;
aPolyLine.Clickable:= NOT aPolyLine.Clickable;
EndUpdate;
end;