osm_flutter icon indicating copy to clipboard operation
osm_flutter copied to clipboard

marker position is inaccurate when zoomed out.

Open horo99 opened this issue 3 years ago • 11 comments

I noticed that marker position is inaccurate when zoomed out. And for osmdroid, set anchor to Marker.ANCHOR_CENTER, but I haven't found the property in osm_flutter. Is there the property anchor? Or may there be other ways to solve the problem?

horo99 avatar May 14 '22 10:05 horo99

I have the same problem, the marker position is too low (or too far south).

Alisofin avatar Jun 21 '22 16:06 Alisofin

can you provide me image to understand more the problem

liodali avatar Jun 22 '22 19:06 liodali

in this example, I put the marker on "Sainte-Maxime", visible on the most zoomed-in view. When zoomed out, the marker seems to be in the sea... Simulator Screen Shot - iPhone 13 Pro - 2022-06-23 at 15 31 28

Simulator Screen Shot - iPhone 13 Pro - 2022-06-23 at 15 30 39 #2

Alisofin avatar Jun 23 '22 13:06 Alisofin

ok thanks i will fix that

liodali avatar Jun 23 '22 14:06 liodali

Any updates on this? I'm seeing very similar on my end.

If I set a map pin on current location, then zoom out, it drifts from Ottawa Ontario all the way north and slightly east to Cape Dorset Nunavut (2000km+ away lol)

If I zoom out and place another pin to current location, it also gets mapped up north with the other one. The GPS coordinates for current location are correct regardless of zoom level, so I suspect it has to do with the pin rendering

T1960CT avatar Dec 07 '22 19:12 T1960CT

for now i didn't go deeper for this issue yet

liodali avatar Dec 07 '22 20:12 liodali

I have the same issue. As far as I can tell it is mainly a problem due to the fact that the anchor of the marker is set at the bottom-center of the image. If you have (a lot of) whitespace at the bottom then the location of the marker will be very inaccurate. I would like to have the option to center the anchor as horo99 suggests in the original comment.

I have created an example repo that can be used for testing. I use a solid white rectangle to make it clear where an image gets drawn. I have also drawn a cross at the marker location using the drawRoadManually function. As you can see the anchor for the image is at the bottom. marker_location

The repo with the example: marker_location_example.zip

SimonPrins avatar Dec 23 '22 15:12 SimonPrins

I will check it, I have lot of technical issue here because for user location should like that I will see how we can fix that and you should know when you zoom out to 1->9 zoom level there no need for markers but we will see for now I can not look at it sorry

liodali avatar Dec 23 '22 18:12 liodali

is it fixed now? i have same problem

smiesnyrobert avatar Apr 26 '23 15:04 smiesnyrobert

Hi, The same problem with me if I create custom icon marker using userLocationMarker. But if using default marker, there is no problem when zoom in/out. So it's good if you have fix the issue so I can custom the marker. Hope the fix will come out soon.

Thank you.

edwinkomalaICI avatar Jul 21 '23 08:07 edwinkomalaICI

I will fix that issue and also i next version we will add feature to set anchor for markers

liodali avatar Jul 22 '23 11:07 liodali