In the application I have integrated the jcOpenMapViewto which I add some points of interest with AddMarks.
The first time I open the form everything works normally. If I close the form and try to reopen the map then the application closes.
If I skip the AddMarks command then the form opens normally.
I tried the refresh commands as well as ClearMarks () but to no avail.
Can anyone tell me what I am doing wrong?
The following code works as many times as I call the form
jListView1.clear ;
if jcOpenMapView1.GetMarkersCount() > 0 then
jcOpenMapView1.ClearMarkers();
jcOpenMapView1.Refresh ;
posx:=0; posy:=0;
jcOpenMapView1.Refresh ;
MyDatab.Cursor.MoveToFirst ;
while MyDatab.Cursor.GetPosition<MyDatab.Cursor.GetRowCount do
begin
posx:=MyDatab.Cursor.GetValueAsDouble (5);
posy:=MyDatab.Cursor.GetValueAsDouble (4);
apoint :=inttostr(MyDatab.Cursor.GetValueAsInteger(2));
// jcOpenMapView1.AddMarker(posx,posy,apoint,'locpin');
jListView1.Add(MyDatab.Cursor.GetValueAsString(1)
+'('+apoint
+' '+MyDatab.Cursor.GetValueAsString(3)+')') ;
MyDatab.Cursor.MoveToNext ;
end;
The code below only works the first time I call the form
jListView1.clear ;
if jcOpenMapView1.GetMarkersCount() > 0 then
jcOpenMapView1.ClearMarkers();
jcOpenMapView1.Refresh ;
posx:=0; posy:=0;
jcOpenMapView1.Refresh ;
MyDatab.Cursor.MoveToFirst ;
while MyDatab.Cursor.GetPosition<MyDatab.Cursor.GetRowCount do
begin
posx:=MyDatab.Cursor.GetValueAsDouble (5);
posy:=MyDatab.Cursor.GetValueAsDouble (4);
apoint :=inttostr(MyDatab.Cursor.GetValueAsInteger(2));
jcOpenMapView1.AddMarker(posx,posy,apoint,'locpin');
jListView1.Add(MyDatab.Cursor.GetValueAsString(1)
+'('+apoint
+' '+MyDatab.Cursor.GetValueAsString(3)+')') ;
MyDatab.Cursor.MoveToNext ;
end;