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:

  1. 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!

Link to 1 part

Link to 2 part

Link to 3 part

Lint to 4 part

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store