Android Question Image overlays with the B4XMap library

AlpVir

Well-Known Member
Licensed User
Longtime User
With
B4X:
shapes.Add(coMapUtilities.instanceShapeImage(fcvMap,coMapUtilities.initShapeImage(coMapUtilities.initLatLng(Lt,Lg),xui.LoadBitmapResize(File.DirAssets,"Point_OK.png",24dip,24dip,True),0,"OK")))
I can superimpose an image on a map created with B4XMap.
However the image is not positioned in the exact coordinate, but slightly higher.
This is very evident if the image is to be superimposed exactly on a GPS track (see attachment)
The midpoint of the bottom side of the image is placed at coordinates (lt,lg) with a not very nice effect.
Can this problem be remedied?
Thanks in advance.
 

Attachments

  • Point.jpg
    Point.jpg
    64.7 KB · Views: 136

RB Smissaert

Well-Known Member
Licensed User
Longtime User
With
B4X:
shapes.Add(coMapUtilities.instanceShapeImage(fcvMap,coMapUtilities.initShapeImage(coMapUtilities.initLatLng(Lt,Lg),xui.LoadBitmapResize(File.DirAssets,"Point_OK.png",24dip,24dip,True),0,"OK")))
I can superimpose an image on a map created with B4XMap.
However the image is not positioned in the exact coordinate, but slightly higher.
This is very evident if the image is to be superimposed exactly on a GPS track (see attachment)
The midpoint of the bottom side of the image is placed at coordinates (lt,lg) with a not very nice effect.
Can this problem be remedied?
Thanks in advance.
There must be many different ways to solve this.
1. Draw lines instead of using an image
2. Draw a circle. I think the circle is centered at the specified coordinates.
3. If you prefer to use an image then adjust the specified coordinates.
I guess how to do this depends on the size of the image and the zoom factor.
4. If you use the classes then you could alter the initShapeImage procedure.
Of course you could then make a new library again from your altered classes.

RBS
 
Upvote 0
Top