Legacy cloud styling examples

Run the ApiDemos sample app

To run the ApiDemos sample app, see the GitHub sample Google Map sample app and view the CloudBasedMapStylingViewController project (GitHub sample for Swift | Objective-C).

Optional Cloud styling CocoaPod or GitHub demo

Instead of starting from scratch, you can try out our Objective-C sample application that demonstrates how to style your iOS map from the cloud. For details, see Objective-C sample.

Build the Beta demo app

In Xcode, press the compile button to build and then run the current scheme. The build produces an error, prompting you to enter your API key in the SDKDemoAPIKey.h file.

If you don't yet have an API key, set up a project on the Cloud console and get an API key by following the instructions in Get an API key. When configuring the key on the Cloud console, you can specify your app's bundle identifier to ensure that only your app can use the key. The default bundle identifier of the SDK samples app is com.example.GoogleMapsDemos.

Edit the SDKDemoAPIKey.h file and paste your API key into the definition of the kAPIKey constant:

static NSString *const kAPIKey = @"YOUR_API_KEY";

If Xcode prompts you to unlock the SDKDemoAPIKey.h file for editing, choose Unlock.

Remove the following line:

```
#error Register for API Key and insert here.
```

Build and run the project.

Cloud styling map demo

The CloudStyling demo shows how to style the map by using a style set on Google Cloud console.

When the demo application launches, click the Map Customization demo in the Beta Samples section at the top of the list.

Click Style Map to see the effect of loading different map IDs.

You can try adding your own style as well ("Style Map" > "Add a new map ID"), and see the map update with your custom styled map.