Google Maps Integration iOS Swift. Part 5
Description: — GoogleMaps with custom theme and Clustering. iOS Swift
And the almost final step it’s — change map appereance:
Google Maps SDK provides us a few options to change map appearance, we’ll consider the option with storing style JSON file inside bundle
So let’s begin:
- We need to go to MapStyleWithGoogle
2. Then just select or config your own style
3. When you will be ready just click finish button and then copy JSON string
4. Then go to Xcode and create new Empty file, and call hime style.json, and finally paste your json inside this file
5. Now we need to pass the new them inside our MapView, it’s pretty ease to do this. Inside our MapViewController we need just update our configMapView function to this:
private func configMapView() {mapView?.isMyLocationEnabled = trueif let path = Bundle.main.url(forResource: "style",withExtension: "json") {mapView?.mapStyle = try? .init(contentsOfFileURL: path)}}
6. Run the app:
BAAAM! Just look at this map, great job!