Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 views
in Technique[技术] by (71.8m points)

android - Flutter Google maps - how to use Cloud Styling

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It seems like this feature is not yet supported by the google_maps_flutter package and there's no pull request for it yet.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...