Android Question [Solved] Remove Points Of Interest in Google Maps

GGSoft

Member
Licensed User
Longtime User
Is it possible to remove the markers of the points of interest in Google Maps so that only the markers that I add appear?
 

Omar Parra A.

Expert
Licensed User
Longtime User
Use style:

1627693791390.png
1627694570771.png
1627694665652.png
 
Last edited:
Upvote 0

Omar Parra A.

Expert
Licensed User
Longtime User
B4X:
    Wait For MapFragment1_Ready
    GoogleMap1 = MapFragment1.GetMap
    
    Dim MapStyle As String = $"[{"featureType":"poi","stylers":[{"visibility": "off"}]}]"$
    SetGoogleMapStyle(GoogleMap1, MapStyle)

B4X:
Public Sub SetGoogleMapStyle(mGoogleMap As GoogleMap, mMapStyle As String) As Boolean
    Dim jo As JavaObject = mGoogleMap
    Dim style As JavaObject
    style.InitializeNewInstance("com.google.android.gms.maps.model.MapStyleOptions", Array(mMapStyle))
    Return jo.RunMethod("setMapStyle", Array(style))
End Sub
 
Last edited:
Upvote 0

GGSoft

Member
Licensed User
Longtime User
B4X:
    Wait For MapFragment1_Ready
    GoogleMap1 = MapFragment1.GetMap
   
    Dim MapStyle As String = $"[{"featureType":"poi","stylers":[{"visibility": "off"}]}]"$
    SetGoogleMapStyle(GoogleMap1, MapStyle)

B4X:
Public Sub SetGoogleMapStyle(mGoogleMap As GoogleMap, mMapStyle As String) As Boolean
    Dim jo As JavaObject = mGoogleMap
    Dim style As JavaObject
    style.InitializeNewInstance("com.google.android.gms.maps.model.MapStyleOptions", Array(mMapStyle))
    Return jo.RunMethod("setMapStyle", Array(style))
End Sub
Works great. Thanks again.
 
Upvote 0
Top