B4A Library GoogleMapStyler

this is a wrap for this Github project.

GoogleMapStyler
Author:
DonManfred (wrapper)
Version: 1
GoogleMapStyler
Methods:

  • setAllPoiParkTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all resturant park labels.
    color: color to be applied for the label
  • setAllPoiTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all resturant labels.
    color: color to be applied for the label
  • setAllRoadHighwayStrokeColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets stroke color for all highway roads.
    color: color to be applied for the stoke
  • setAllRoadTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets label color for all roads.
    color: color to be applied for the label
  • setAllRoadLocalStrokeColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets stroke color for all local roads.
    color: color to be applied for the stroke
  • setAllTransitStationTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets label color for all transit stations.
    color: color to be applied for the label
  • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
  • setCustomFeatureLightness (featureType As java.lang.String, elementType As java.lang.String, lightness As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets custom feature lightness to be applied
    for more details visit https://developers.google.com/maps/documentation/javascript/style-reference
    featureType: type of feature to be added
    elementType: element in which property to be applied
    lightness: color to be applied
  • setAllRoadHighwayBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all highway roads.
    color: color to be applied
  • setAllRoadLocalBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all local roads.
    color: color to be applied
  • setAllTransitBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all transits.
    color: color to be applied
  • setAllRoadArterialStrokeColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets stroke color for all arterial roads.arterial means important route in a system of roads, railway lines, or rivers.
    color: color to be applied for the stroke
  • setAllMainTownTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all main city labels.
    color: color to be applied for the label
  • setAllWaterTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for labels in water.
    color: color to be applied for the label
  • setAllWaterTextStrokeAlpha (lightness As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets stroke alpha for labels in water.
    lightness: alpha to be applied,use -ve values for lesser alpha and +ve values for increased alpha
  • setMainGeometryColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets background color for all the continentals
    color: background color to be applied
  • setAllPlaceTextStrokeAlpha (lightness As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets text stroke to all place labels
    lightness: alpha to be applied,use -ve values for lesser alpha and +ve values for increased alpha
  • setAllWaterBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for water.
    color: color to be applied
  • setAllRoadHighwayTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for labels in all highway roads.
    color: color to be applied for the label
  • setAllRoadArterialBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all arterial roads.arterial means important route in a system of roads, railway lines, or rivers.
    color: color to be applied
  • setCustomFeatureColor (featureType As java.lang.String, elementType As java.lang.String, color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets custom feature color to be applied
    for more details visit https://developers.google.com/maps/documentation/javascript/style-reference
    featureType: type of feature to be added
    elementType: element in which property to be applied
    color: color to be applied
  • setAllPlaceTextColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all the place texts excluding water label text,main city text etc.
    color: color to be applied for the label
  • setAllRoadBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets color for all roads.
    color: color to be applied for the road
  • build (map As com.google.android.gms.maps.GoogleMap) As void
    Call this method to build the
    GoogleMapStyler and to apply
    it to the given GoogleMap.
    Call this only after you set
    all Colors like you wish as it
    applies the setting to GoogleMap
  • setAllPoiParkBackgroundColor (color As int) As de.donmanfred.GoogleMapStylerWrapper
    Sets background color for all resturant parks.
    color: color to be applied for resturant parks

Example of use

1. B4A 6+ is required
2. Your app must already implement googleMap
3. Example code

B4X:
Sub Globals
   Private gmap As GoogleMap
   Private MapFragment1 As MapFragment
     Private styler As GoogleMapStyler
End Sub
Sub Activity_Create(FirstTime As Boolean)
    styler.Initialize("")
    'Activity.LoadLayout("1")
   Dim p As Panel
     p.Initialize("Panel")
     Activity.AddView(p,0,0,100%x,100%y)
     p.LoadLayout("1")
     If MapFragment1.IsGooglePlayServicesAvailable = False Then
     ToastMessageShow("Please install Google Play Services.", True)
   End If
End Sub

Sub MapFragment1_Ready
  Log("MapFragment1_Ready")
    gmap = MapFragment1.GetMap
    styler.setAllMainTownTextColor(Colors.Red).setAllRoadBackgroundColor(Colors.Magenta)
    ' Set all colors like you wish before next line....
    styler.build(gmap)    
End Sub
 

Attachments

  • GoogleMapStylerV1.0.zip
    6 KB · Views: 680

jamesnz

Active Member
Licensed User
Longtime User
Brilliant, I'm assuming this won't work for iOS? If not what would it take to get this converted to an iOS lib.
 

DonManfred

Expert
Licensed User
Longtime User
Top