Looking for advanced features to add to your maps? The Maps SDK for iOS Utility Library on GitHub is an open-source library of classes that are useful for a range of applications. The GitHub repository includes the utility classes and a demo app that illustrates the use of each class.
Quick start
Run the demo app by using one of these two methods:
Use files from GitHub
- Download the code sample archive from GitHub and unpack the archive.
- Open a terminal window, navigate to the directory where you expanded the sample files, and
drill down into the appropriate samples directory for the language you want to use:
- For Swift, run
cd google-maps-ios-utils-master/samples/SwiftDemoApp
- For Objective-C, run
cd google-maps-ios-utils-master/samples/ObjCDemoApp
- For Swift, run
- Run the following command:
pod install
- CocoaPods updates your spec repositories, then opens the demo in a temporary Xcode project
named
SwiftDemoApp.xcodeproj
orObjCDemoApp.xcodeproj
.
Use CocoaPods v1.6.1
- Open a terminal window and install version 1.6.1:
sudo gem install cocoapods -v1.6.1
- Fetch the Google Maps files using Cocoapods:
pod try Google-Maps-iOS-Utils
Choose either Swift or Objective-C when prompted. CocoaPods updates your spec repositories, then opens the demo in a temporary Xcode project named
SwiftDemoApp.xcodeproj
orObjCDemoApp.xcodeproj
.
For more details, follow the setup guide.
The utilities
Manage marker clusters
The GMUClusterManager
helps you manage multiple markers at
different zoom levels. This means you can put a large number of markers
on a map without making the map hard to read. When a user views the map
at a high zoom level, the individual markers show on the map. When the
user zooms out to a lower zoom level, the markers gather together into
clusters, to make viewing the map easier.
Create a quadtree to track points in a given area
A quadtree is a data structure that's useful for finding points near a single point, by searching inside an area surrounding the point of interest.
Render KML and GeoJSON
KML and GeoJSON are popular formats for rendering geographic data such as
points, lines, and polygons. The GMUKMLParser
and
GMUGeoJSONParser
let you parse and render geographic data in
KML and GeoJSON formats, respectively.
Add heatmaps to your map
Heatmaps make it easy for viewers to understand the distribution and relative intensity of data points on a map. Rather than placing a marker at each location, heatmaps use color and shape to represent the distribution of data.