There are an increasing number of buildings with floor plans available in Google Maps. Whilst this may be a desireable feature in normal view I am implementing Satellite view for a particular purpose. When you reach a certain zoom level the floor plan replaces the satellite view.
Can this 'feature' be supressed so the floor plan never appears?
....... I see from a post on Stackoverflow that a Java property .setIndoorEnabled(false) can be set.
GoogleMapsExtras is an ongoing project to implement more of the Google Maps Android v2 classes in Basic4Android. Currently the library allows you to create these objects: BitmapDescriptor BitmapDescriptorFactory Circle CircleOptions GroundOverlay InfoWindowAdapter MarkerOptions Point...
Thanks @oparra but the designer property 'Buildings Enabled' is already unchecked. Something in my code appears to be switching it back on again.
This code snippet below is used to suppress Google Maps points of interest. Could it be this code that is enabling floor plans again? If so what properties can be changed to return the desired result?
Switch Off Google Maps POI:
..........
Dim MapStyle As String = $"[{"featureType":"poi","stylers":[{"visibility": "off"}]}]"$
SetGoogleMapStyle(Gmap, MapStyle)
.......
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
After a bit of experimentation the issue is resolved. The designer property of BuildingEnable is a little misleading as it does not affect the layer in question. The desired result is obtained with the GoogleMapsExtras Lib.
B4X:
GoogleMapsExtras.SetIndoorEnabled(Gmap,False)
The Java Object code above used to suppress the Points Of Interest appears quite compatible and does not interfere with the desired result.
Thanks @oparra but the designer property 'Buildings Enabled' is already unchecked. Something in my code appears to be switching it back on again.
This code snippet below is used to suppress Google Maps points of interest. Could it be this code that is enabling floor plans again? If so what properties can be changed to return the desired result?
Switch Off Google Maps POI:
..........
Dim MapStyle As String = $"[{"featureType":"poi","stylers":[{"visibility": "off"}]}]"$
SetGoogleMapStyle(Gmap, MapStyle)
.......
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