iOS Question InfoWindowAdapter1 or iOS ?

ykucuk

Well-Known Member
Licensed User
Longtime User
is there a way change Infowindow of google map view?

'Android
B4X:
Dim InfoWindowAdapter1 As InfoWindowAdapter
    InfoWindowAdapter1.Initialize("InfoWindowAdapter1")
  GoogleMapsExtras1.SetInfoWindowAdapter(gmap, InfoWindowAdapter1)
  
  InfoWindowPanel.Initialize("")
  InfoWindowPanel.LoadLayout("MapInfoWindow") 'Load your layout with whatever
  '  a hack(ish) way to set InfoWindowPanel width and height!
  MapPanel.AddView(InfoWindowPanel, 0, 0, 270dip, 200dip) 
  InfoWindowPanel.RemoveView
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

ykucuk

Well-Known Member
Licensed User
Longtime User
BTW, this code is wrong. You should never load the layout before the size is set.
You can call InfoWindowPanel.SetLayout. It was not possible in older versions of B4A.

It is now possible to create custom info windows: https://www.b4x.com/android/forum/threads/class-googlemapsextra.56871/

Thank you Erel,

I added below code but it still shows snippet not custom panel . How can i set ?
B4X:
gmap.Initialize("gmap", ApiKey)

PanelMap.AddView(gmap, 0, 0, screenWidth, screenHeight*0.95)

gmap.GetUiSettings.CompassEnabled = True

gmap.MyLocationEnabled = True

gextra.Initialize(gmap)

Dim m As Marker = gmap.AddMarker(40, 30, "test")

m.Snippet = "Marker 1"

m.Opacity = 0.5

m = gmap.AddMarker2(32, 35, "Marker 2", Colors.Green)


gextra.SetSelectedMarker(m)


Sub gmap_MarkerInfoWindow (OMarker As Object) As Object

Dim SelectedMarker As Marker = OMarker

Dim p As Panel

p.Initialize("")

p.Color = Colors.Red

p.SetLayoutAnimated(0, 1, 0, 0, 200, 200)

Dim lbl As Label

lbl.Initialize("")

lbl.Text = SelectedMarker.Title

p.AddView(lbl, 10, 10, 200, 200)

Return p

End Sub
 

Attachments

  • Screen Shot 2018-08-15 at 14.48.03.png
    Screen Shot 2018-08-15 at 14.48.03.png
    21 KB · Views: 128
Upvote 0
Top