Cannot change colour and opacity of Polygons

I am using recent version of TMSFNCMaps with Delphi 13 and keep getting a range check error when trying to implement colouring and opacity for polygons loaded from a GeoJSON file. Current code is:

try
  TMSFNCMaps1.BeginUpdate;
  TMSFNCMaps1.Polygons.Clear;
  TMSFNCMaps1.Clear;
  TMSFNCMaps1.LoadGeoJSONFromFile(JSONfileName,true,false);
  for iPoly := 1 to TMSFNCMaps1.Polygons.Count do
  begin
    PPoly := TMSFNCMaps1.Polygons[iPoly-1];
    PPoly.StrokeColor := claBlueViolet;
    PPoly.StrokeOpacity := 0.3;
    PPoly.StrokeWidth := 2;
    PPoly.FillColor := claWhite;
    PPoly.FillOpacity := 0.0;
  end;
finally
  TMSFNCMaps1.EndUpdate;
end;

PPoly is defined to be of type TTMSFNCMapsPolygon.

If I omit the for loop, the polygon dataset loads and plots with opaque white fill and black outlines. The for loop will execute as long as I comment out all the PPoly.something statements.

Am I missing some command? The range check is not related to the iPoly value from anything I have tried.

Any suggestions would be much appreciated.

Bruce

Hi,

We have not been able to reproduce the issue you reported.
This is likely related to the specific GeoJSON file you are using.
Can you please provide a GeoJSON file that is causing the issue for you so we can investigate this further?

test_fncmaps_mn.zip (4.3 MB)

Test program tries to load one of the GeoJSON file from button 5 and to colour/opacity them and tries to clear and load a second file from button6 with colouring, opacity, etc.

While looking at this, please could you also comment on the best way to clear all content in an exisitng FNCMaps item before loading new content.

Thanks

Bruce