iOS Question How add high quality marker on Map? [SOLVED]

webhost.company

Active Member
Licensed User
Longtime User
My codes :
B4X:
Dim marker_icon As Bitmap = LoadBitmap(File.DirAssets,"marker.png")
Dim m As Marker = map1.GetMap.AddMarker3(ChooseLocation.Latitude,ChooseLocation.Longitude,"Your location",marker_icon.Resize(45dip,45dip,True))

Why added marker icon is low quality?
While my icon is high quality with 150px in 150px

I think that I have to load image from Special folders, is that?
Please help me
 

webhost.company

Active Member
Licensed User
Longtime User
The problem was solved with below code :
B4X:
Dim scale As Float = GetDeviceLayoutValues.NonnormalizedScale

Dim marker_icon As Bitmap = LoadBitmap(File.DirAssets,"marker.png")

Dim m As Marker = map1.GetMap.AddMarker3(ChooseLocation.Latitude,ChooseLocation.Longitude,"Your location",marker_icon.Resize(45dip * scale,45dip * scale,True))
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
test:

use XUI library.
B4X:
    Dim xui As XUI
    Dim marker_icon As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "marker.png", 26dip, 26dip, True)
    Dim m As Marker = map1.GetMap.AddMarker3(ChooseLocation.Latitude,ChooseLocation.Longitude,"Your location",marker_icon)

note:
the size showing fine in my app is 24dip or 26dip
 
Upvote 0
Top