Android Question How can center a bitmap in Google Maps.

ELCHARO

Member
Licensed User
Longtime User
Hi!

If insert a bitmap and draw a circle with same latitud and longuitud, the center of bitmap is a bottom a are high.

How center the bitmap in the center or circle?

Thanks.
 

ELCHARO

Member
Licensed User
Longtime User
Erel: The code is easy.
I draw a marker and need to create a circle around to determinate an area.
Depending of zoom you have the image results. The center of bitmap latlon (0,0) is on bottom. And not in the center marker.




B4X:
    Dim bmd =BitmapDescriptorFactory1.FromBitmap(LoadBitmap(File.DirAssets, "modissat_ch.png")) As BitmapDescriptor
    Dim mo As MarkerOptions
    mo.Initialize
'--------------------------------------------------
    mo.Position2(0,0)  ' same as circle
'--------------------------------------------------
    mo.Icon(bmd)
    mo.Visible(True)

    gmape.AddMarker(gmap, mo)

    Dim  cop As CircleOptions
    cop.Initialize
'--------------------------------------------------   
    cop.Center2(0,0)  ' same as bitmap
'--------------------------------------------------
    cop.Visible(True)
    cop.StrokeWidth(4)
    cop.StrokeColor(Colors.Red)
    cop.Radius(10000)    'if static grow or not like zoom terrain  ,the marker not.
    gmape.AddCircle (gmap, cop)
 

Attachments

  • Screenshot_20180220-100423.jpg
    Screenshot_20180220-100423.jpg
    47.5 KB · Views: 151
Last edited:
Upvote 0
Top