Recent

Author Topic: [LAMW ]jcOpenMapView component issues  (Read 3656 times)

dseligo

  • Hero Member
  • *****
  • Posts: 1221
[LAMW ]jcOpenMapView component issues
« on: December 13, 2021, 05:23:17 pm »
I have a couple of issues with jcOpenMapView component.

1. Biggest issue I have is with marker position.
When I run application in emulator everything is fine (built to x86_64 chipset).
But if I run application in real device (I tried Samsung S9 and Huawei P40 lite, built to Aarch64 chipset) then markers are not fixed on the map, depending on zoom level they change position.
I tried demo AppJCenterOpenStreetMapDemo1 and it shows same behaviour.

I am adding markers with AddMarker method, this is example code I made screenshots with:
Code: [Select]
procedure TfmGeoLokacija.btnOdaberiClick(Sender: TObject);
begin
  jcOpenMapView1.SetCenter(45.81560000, 15.84175545);
  jcOpenMapView1.AddMarker(45.81560000, 15.84175545, 'trenutni_polozaj');

  jcOpenMapView1.AddMarker(45.81545765, 15.84082395, '101-00111', 'pos A', 'no_file');
  jcOpenMapView1.AddMarker(45.81538239, 15.84175545, '102-00222', 'pos B', 'marker64');
  jcOpenMapView1.AddMarker(45.81533042, 15.84270626, '103-00333', 'pos C', 'no_file');
end;

5th parameter of AddMarker method is _iconIdentifier. If coresponding file does not exist in res\drawable directory, then some green marker with hand in it is drawn (this green marker file doesn't exist in the res\drawable). But it is drawn in the right position and it doesn't change position when zooming.

In the attached screenshot you can see how red pin and red cross are moving down and slightly to the right. The green pins are fixed, bellow the yellow road.


2. In the OnMarkerClick event, latitude is returned in longitude parameter.
It looks that problem is in jcOpenMapView.java file, in lines like this: 'controls.pOnOpenMapViewMarkerClick(pascalObj, marker.getTitle(),  marker.getPosition().getLatitude(), marker.getPosition().getLatitude());', getLatitude() is used twice.
This happens in lines: 422, 447, 476, 504, 530, 560, 590, 618, 642 and 665.


3. Why is the same file (jcOpenMapView.java) in method AddMarker in lines 416 and 441 hardcoded 'marker.setDraggable(true);', while in other versions of this method and method DrawMarker is 'marker.setDraggable(IsMarkerDraggable);'. Could that be changed in lines 416 and 441 too?


4. When zoom is changed with '+' or '-' buttons on map, property jcOpenMapView.Zoom doesn't change accordingely.


5. Is there a way to force map loading? Sometimes (maybe because of Internet connection), all tiles doesn't load.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: [LAMW ]jcOpenMapView component issues
« Reply #1 on: December 17, 2021, 01:50:18 am »
issue 2. Fixed!

issue 3. Fixed!


Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018