Delphi-Quellcode:
function TForm2.Add(const line: Tstrings): integer;
var
i : Integer;
j : Integer;
oSLArray : array of TStringList;
oSL : TStringList;
begin
if not(Assigned(line)) then exit;
SetLength(oSLArray, line.Count);
for i := 0 to line.Count - 1 do begin
oSLArray[i] := TStringList.Create;
oSLArray[i].Delimiter := ' ';
oSLArray[i].DelimitedText := line[i];
for j := 0 to oSLArray[i].Count-1 do begin
Showmessage( oSLArray[i].Strings[j]);
end; {for j}
end; {for i}
end;
Function TForm2.Polygon:integer;
var
Slat,Slon: string;
Poly : TMapPolygon;
PItem : TPolygonItem;
Pi : TPathItem;
Count,i : Integer;
IdPolygon: Integer;
begin
Result:=-1;
WebOSMaps1.Markers.Clear;
PItem := WebOSMaps1.Polygons.Add;
Poly := PItem.Polygon;
Poly.PolygonType := ptpath;
Poly.BorderWidth := 4;
Poly.BorderColor := clWebDarkBlue;
Poly.BorderOpacity := 100;
Poly.LabelFont.Style := [fsBold];
Poly.LabelOffset.Y := 200;
Poly.LabelFont.Color := clWebDarkBlue;
Poly.LabelText := ('Das Polygon hat :'+IntToStr((RichEdit1.Lines.count)div 2)+' Eckpunkte');
if RichEdit1.Lines[0] <> '' then begin
WebOSMaps1.MapOptions.DefaultLatitude:=strtofloat(RichEdit1.Lines[0]);
WebOSMaps1.MapOptions.DefaultLongitude:=strtofloat(RichEdit1.Lines[1]);
WebOSMaps1.MapPanTo(WebOSMaps1.MapOptions.DefaultLatitude,WebOSMaps1.MapOptions.DefaultLongitude);
WebOSMaps1.MapOptions.ZoomMap:=18;
i := 0;
repeat
Slat := left(RichEdit1.Lines[2 * i],10);
Slon := left(RichEdit1.Lines[2 * i + 1],11);
Pi := Poly.Path.Add;
Pi.Latitude :=strtofloat(SLat);
Pi.Longitude := strtofloat(SLon);
inc(i);
until (RichEdit1.Lines[2 * i + 1] = '');
WebOSMaps1.CreateMapPolygon(Poly);
end;
Result:= Poly.ItemIndex;
Showmessage(inttostr(Poly.ItemIndex));
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
polygon;
Add(RichEdit1.Lines);
end;
wie kann ich für jeden Ort (Richtedit1.lines)Speicheren und nochmal aufrufen!!!