0

I'm writing some code to show 3 concentric circles for each defined location, and a combobox to change the color of these circles.

When I change the combo value 2 - 3 times, the last added circle from one random location (almost always the last one added) fires the RadiusChangeEvent.

Here is the creation code for the Cicles:

for I := 0 to Length(lEstaciones) -1 do
begin
  circulos.Add(lEstaciones[i].getLat, lEstaciones[i].getLon, radio*4);
  circulos.Items[3*i].FillColor := color;
  circulos.Items[3*i].StrokeColor := color;
  circulos.Items[3*i].FillOpacity := 0.25;
  circulos.Items[3*i].StrokeWeight := 0;
  circulos.Items[3*i].Visible := true;
  circulos.Add(lEstaciones[i].getLat, lEstaciones[i].getLon, radio*8);
  circulos.Items[3*i+1].FillColor := color;
  circulos.Items[3*i+1].StrokeColor := color;
  circulos.Items[3*i+1].FillOpacity := 0.25;
  circulos.Items[3*i+1].StrokeWeight := 0;
  circulos.Items[3*i+1].Visible := true;
  circulos.Add(lEstaciones[i].getLat, lEstaciones[i].getLon, radio*12);
  circulos.Items[3*i+2].FillColor := color;
  circulos.Items[3*i+2].StrokeColor := color;
  circulos.Items[3*i+2].FillOpacity := 0.25;
  circulos.Items[3*i+2].StrokeWeight := 0;
  circulos.Items[3*i+2].Visible := true;
end;

And the code to change the color:

  for I := 0 to Length(lEstaciones) -1 do
  begin
    circulos.Items[3*i].FillColor := color;
    circulos.Items[3*i].StrokeColor := color;
    circulos.Items[3*i].FillOpacity := 0.25;
    circulos.Items[3*i].StrokeWeight := 0;
    circulos.Items[3*i].Visible := true;
    circulos.Items[3*i+1].FillColor := color;
    circulos.Items[3*i+1].StrokeColor := color;
    circulos.Items[3*i+1].FillOpacity := 0.25;
    circulos.Items[3*i+1].StrokeWeight := 0;
    circulos.Items[3*i+1].Visible := true;
    circulos.Items[3*i+2].FillColor := color;
    circulos.Items[3*i+2].StrokeColor := color;
    circulos.Items[3*i+2].FillOpacity := 0.25;
    circulos.Items[3*i+2].StrokeWeight := 0;
    circulos.Items[3*i+2].Visible := true;
  end;
end;

Thx.

0 Answers0