Reputation: 803
I was just reading about the possibilities to style the Google maps through the Cloud. This makes it easier to style them without actually needing to redeploy the application.
Here are the 2 documentations I found for Android and IOS:
For Android it seems like a simple solution, just add the fragment to the xml file and that's it. Unfortunately for IOS, you need to initialise it when creating the Google Maps.
example Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="map_id">YOUR_MAP_ID</string>
</resources>
example IOS
let camera = GMSCameraPosition(latitude: 47.0169, longitude: -122.336471, zoom: 12)
let mapID = GMSMapID(identifier: "<YOUR MAP ID>")
let mapView = GMSMapView(frame: .zero, mapID: mapID, camera: camera)
self.view = mapView
This in combination with the flutter plugins, seems like a lot of overhead. Is there maybe a simpler way to add the MapId? For now I'm using the https://pub.dev/packages/google_maps_flutter plugin
Upvotes: 7
Views: 1940
Reputation: 379
In google_maps_flutter: 2.5.0 Added implementation for cloudMapId parameter to support cloud-based maps styling.
Google Cloud -> Google Map Platforms -> Map Styles
now you can add in GoogleMap Widget as below and change the map styles without updating the app on play console and app store.
GoogleMap(
initialCameraPosition: CameraPosition(
target: LatLng(
latitude,
longitude,
),
zoom: 16),
cloudMapId: '458e9b5bh7359390',
),
Upvotes: 0
Reputation: 11137
It seems like this feature is not yet supported by the google_maps_flutter
package and there's no pull request for it yet.
Upvotes: 5