Recent

Author Topic: LAMW jcOpenMapView  (Read 687 times)

magleft

  • Full Member
  • ***
  • Posts: 125
LAMW jcOpenMapView
« on: April 02, 2022, 04:19:11 pm »
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
Code: Pascal  [Select][+][-]
  1.   jListView1.clear ;
  2.    if jcOpenMapView1.GetMarkersCount() > 0 then
  3.         jcOpenMapView1.ClearMarkers();
  4.   jcOpenMapView1.Refresh  ;
  5.   posx:=0; posy:=0;
  6.   jcOpenMapView1.Refresh  ;
  7.   MyDatab.Cursor.MoveToFirst   ;
  8.   while MyDatab.Cursor.GetPosition<MyDatab.Cursor.GetRowCount do
  9.   begin
  10.        posx:=MyDatab.Cursor.GetValueAsDouble (5);
  11.        posy:=MyDatab.Cursor.GetValueAsDouble (4);
  12.        apoint :=inttostr(MyDatab.Cursor.GetValueAsInteger(2));
  13. //       jcOpenMapView1.AddMarker(posx,posy,apoint,'locpin');
  14.        jListView1.Add(MyDatab.Cursor.GetValueAsString(1)
  15.                    +'('+apoint
  16.                    +' '+MyDatab.Cursor.GetValueAsString(3)+')')   ;
  17.        MyDatab.Cursor.MoveToNext   ;
  18.   end;
  19.  

The code below only works the first time I call the form

Code: Pascal  [Select][+][-]
  1. jListView1.clear ;
  2.    if jcOpenMapView1.GetMarkersCount() > 0 then
  3.         jcOpenMapView1.ClearMarkers();
  4.   jcOpenMapView1.Refresh  ;
  5.   posx:=0; posy:=0;
  6.   jcOpenMapView1.Refresh  ;
  7.   MyDatab.Cursor.MoveToFirst   ;
  8.   while MyDatab.Cursor.GetPosition<MyDatab.Cursor.GetRowCount do
  9.   begin
  10.        posx:=MyDatab.Cursor.GetValueAsDouble (5);
  11.        posy:=MyDatab.Cursor.GetValueAsDouble (4);
  12.        apoint :=inttostr(MyDatab.Cursor.GetValueAsInteger(2));
  13.        jcOpenMapView1.AddMarker(posx,posy,apoint,'locpin');
  14.        jListView1.Add(MyDatab.Cursor.GetValueAsString(1)
  15.                    +'('+apoint
  16.                    +' '+MyDatab.Cursor.GetValueAsString(3)+')')   ;
  17.        MyDatab.Cursor.MoveToNext   ;
  18.   end;
  19.  
windows 10 64

 

TinyPortal © 2005-2018