Samples for the Google Maps and Places SDKs for iOS
This repository contains sample code for use with the Google Maps SDK for iOS, Google Places SDK for iOS and Google Navigation SDK for iOS.
The GoogleMaps
and GoogleMaps-Swift
sub-directory contains the sample code that is downloaded
when you run pod try GoogleMaps
. To use this project:
For Objective-C samples:
$ cd GoogleMaps
$ pod install
$ open GoogleMapsDemos.xcworkspace
For Swift (UIKit) samples:
$ cd GoogleMaps-Swift
$ pod install
$ open GoogleMapsSwiftDemos.xcworkspace
You will need to add an API Key to GoogleMapsDemos/SDKDemoAPIKey.h
. Please see the
documentation
for details on how to get an API Key.
The GoogleMaps-SwiftUI
sub-directory contains sample code demonstrating how to integrate Google Maps SDK with SwiftUI applications. It provides a modern SwiftUI wrapper around GMSMapView
with a declarative API for common map configurations and interactions. To use this project:
$ cd GoogleMaps-SwiftUI
$ open GoogleMaps-SwiftUI.xcodeproj
You will need to add an API Key to your configuration. Please see the documentation for details on how to get an API Key.
This project uses Swift Package Manager and requires the GoogleMaps package. The sample code demonstrates best practices for integrating Google Maps into SwiftUI-based iOS applications.
The GooglePlaces
and GooglePlaces-Swift
sub-directory contains the sample code that is downloaded
when you run pod try GooglePlaces
. To use this project:
$ cd GooglePlaces
$ pod install
$ open GooglePlacesDemos.xcworkspace
For Swift samples:
$ cd GooglePlaces-Swift
$ pod install
$ open GooglePlacesSwiftDemos.xcworkspace
You will need to add an API Key to GooglePlacesDemos/SDKDemoAPIKey.h
. Please see the
documentation
for details on how to get an API Key.
The GoogleNavigation
and GoogleNavigation-Swift
sub-directory contains the sample code that is downloaded
when you run pod try GoogleNavigation
. To use this project:
$ cd GoogleNavigation
$ pod install
$ open GoogleNavigationDemos.xcworkspace
For Swift samples:
$ cd GoogleNavigation-Swift
$ pod install
$ open GoogleNavigationSwiftDemos.xcworkspace
You will need to add an API Key to GoogleNavigationDemos/SDKDemoAPIKey.h
. Please see the
documentation
for details on how to get an API Key.
This demo application looks to bridge some of the features found in the GooglePlaces and GoogleMaps demo applications as well as utilize some of the ways the two API’s can work together.
Click this link to watch a video demonstration.
This project was made by Haiming Xu as an internship project from 05/2020 to 08/2020
pod install
MapsAndPlacesDemo.xcworkspace
The tutorials
sub-directory contains sample code that accompanies tutorials in the developer
documentation, such as
Adding a Map with a Marker,
and more. Follow the tutorials for a quick guide to using the SDK.
The snippets
sub-directory contains code snippets that can be found in the developer documentation site.
If you find a bug or have a feature request related to these samples, please file an issue.
If you find a bug or have a feature request related to one of the SDKs, you can file an issue on either the
Google Maps SDK for iOS Issue Tracker.or the
Places SDK for iOS Issue Tracker.
You can also discover additional support services for the Google Maps Platform, including developer communities,
technical guidance, and expert support at the Google Maps Platform support resources page.
Thanks!