Android Code Snippet GoogleMapsextra custom infowindow

i try changue default view color of infowindow to transparent
samsung2.png
smasung1.png

I don't know if there is an easier way

I succes it with this code

Transparent Info window:
            sub InfoAdaptador_GetInfoContents(Marca As Marker) As View
                'edit layout components from infopanel
             
               infoPanel.Parent.Color = Colors.Transparent
                return infoPanel
            end sub

this code only works second time show infowindow
i solve this add fake marker and show this (Release Mode)
B4X:
     FakeMark = gmap.AddMarker(0,0,"Fake")
        FakeMark.Snippet=0
        FakeMark.InfoWindowShown=True
        FakeMark.Remove

and add to GetInfoContents

B4X:
Sub InfoAdaptador_GetInfoContents(Mark As Marker) As View

    Try
        If Mark.Snippet = 0 Then
            Return infoPanel
        Else 'Normal operation

             'Work with panel

              infoPanel.Parent.Color = Colors.Transparent
        End If
     
        Catch
        Log(LastException.Message)
    End Try
    Return infoPanel
End if

This is not the most elegant solution but it works!!!

I would like to know if there is another option, I think that the library already has a defined layout so it is necessary to hide it.
 
Last edited:

Daica

Active Member
Licensed User
Hi,

I'm getting "infoPanel.Parent" does not have any objects or functions. Are you doing something else different?
 

TILogistic

Expert
Licensed User
Longtime User
Read:


Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (for example, after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

See:

 
Top