iOS Question Flipping Between GoogleMap.Types [Solved]

RichardN

Well-Known Member
Licensed User
Longtime User
I wish to allow the user to flip between a normal map and satellite view without completely redrawing the map.

It could be quite simple:
B4X:
If gmap.MapType = gmap.MAP_TYPE_NORMAL Then           
    gmap.MapType = gmap.MAP_TYPE_SATELLITE
Else
    gmap.MapType = gmap.MAP_TYPE_NORMAL
End If
Sadly gMap.MapType is Read Only so it can't be done this way.

What is the best way to do this?
 

RichardN

Well-Known Member
Licensed User
Longtime User
After a cup of coffee sat in the sunshine.... the answer is obvious.....
B4X:
Sub Process_Globals
    Private gMap As GoogleMap
    Private MyMapType as Object
End Sum

...........
    MyMapType = gmap.MAP_TYPE_NORMAL
    gMap.MapType = MyMapType
...........

Sub btnFlip_Click            'Flip the map
  
    If MyMapType = gmap.MAP_TYPE_NORMAL Then         
        MyMapType = gmap.MAP_TYPE_SATELLITE
    Else
        MyMapType = gmap.MAP_TYPE_NORMAL
    End If
  
    gmap.MapType = MyMapType

End Sub
 
Last edited:
Upvote 0
Top