Android Question Google Maps - Floor Plans [Solved]

RichardN

Well-Known Member
Licensed User
Longtime User
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.

Can this be exposed in B4A?
 
Last edited:
see:
1634483011089.png
 
Upvote 0
or

Library GoogleMapsExtras

B4X: Copy
GoogleMapsExtras1.SetBuildingsEnabled(GoogleMap1, False)

1634483657045.png
 
Upvote 1
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?

Code: Copy
..........

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
 
Upvote 0
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: Copy
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.
 
Upvote 0
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?

Code: Copy
..........

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

I know this code and it shouldn't affect the map layer.

 
Upvote 0

Similar Threads

  • Article Article
Share My Creation Draw Floor Plan
Replies
10
Views
4K
  • Question Question
Android Question floor plan app
Replies
2
Views
3K
Replies
4
Views
4K
Back
Top