Android Question Position of InfoWindowAdapter

devmobile

Active Member
Licensed User
Hello
I use InfoWindowAdapter in my app.
i can show it well
But when i click on marker and InfoWindowAdapter shown,googlemap change camera to center map and my InfoWindowAdapter is placed on top
Why?
I attach shot of my problem
 

Attachments

  • Untitled.png
    Untitled.png
    147.4 KB · Views: 222

devmobile

Active Member
Licensed User
Hiding the source you are using does not help us to help you.

I guess you change the maps camera position in the marker click event...
I use below code for handle windowinfo
B4X:
        Dim extra As GoogleMapsExtras
      
        Dim mm As InfoWindowAdapter
        mm.Initialize("mm")

        extra.SetInfoWindowAdapter(MapFragment1.GetMap,mm)
      
        p2.Initialize("")
        p2.LoadLayout("frmtemplatemapiten")
        Activity.AddView(p2, 0, 0, Panel1.Width, Panel1.Height)
        p2.RemoveView

And GetInfoContents code :
B4X:
Sub mm_GetInfoContents(Marker1 As Marker) As View
  
    Dim data As Map
    data = Library.Json2Map(Marker1.Snippet)
    lbltitle.Text    =    data.Get("sTitle")
  
    Return p2
  
End Sub
 
Upvote 0

devmobile

Active Member
Licensed User
I use below code for handle windowinfo
B4X:
        Dim extra As GoogleMapsExtras
     
        Dim mm As InfoWindowAdapter
        mm.Initialize("mm")

        extra.SetInfoWindowAdapter(MapFragment1.GetMap,mm)
     
        p2.Initialize("")
        p2.LoadLayout("frmtemplatemapiten")
        Activity.AddView(p2, 0, 0, Panel1.Width, Panel1.Height)
        p2.RemoveView

And GetInfoContents code :
B4X:
Sub mm_GetInfoContents(Marker1 As Marker) As View
 
    Dim data As Map
    data = Library.Json2Map(Marker1.Snippet)
    lbltitle.Text    =    data.Get("sTitle")
 
    Return p2
 
End Sub
I use custom WindowInfo for googlemap.
But when i click on marker,Camera change to center googlemap and show WindowInfo
 
Upvote 0

devmobile

Active Member
Licensed User
what is the code of your marker click event in google maps?
I dont have event for marker click.
Infowindow shown auto when i click on marker.
I use GetInfoContents instead of googlemap infowindow.So it show auto without writing any extra code for show it
 
Upvote 0
Top