This open-source library contains classes that are useful for a wide range of applications using the Google Maps SDK for iOS.
- Geometry libraries - KML and GeoJSON rendering
- Geometry utilities - Handy spherical geometry utility functions
- Heatmaps - Heatmap rendering
- Marker clustering — handles the display of a large number of points
- Marker customization - display custom markers
- Quadtree data structure - indexes 2D geometry points and performs 2D range queries
- iOS 11.0+
In your Podfile
:
use_frameworks!
target 'TARGET_NAME' do
pod 'Google-Maps-iOS-Utils', '~> 4.1.0'
end
Replace TARGET_NAME
and then, in the Podfile
directory, type:
$ pod install
In your Cartfile
:
github "googlemaps/google-maps-ios-utils" ~> 4.1.0
See the Carthage doc for further installation instructions.
Note: This feature is only available with Swift 5.3 (Xcode 12) or later.
Add the following to your dependencies
value of your Package.swift
file.
dependencies: [
.package(
url: "https://github.com/googlemaps/google-maps-ios-utils.git",
.upToNextMinor(from: "4.1.0")
)
]
In addition to this, you will also have to include the GoogleMaps
dependency using one of the available installation options (CocoaPods, Carthage, or manual)
e.g. Displaying KML data
import GoogleMapsUtils
func renderKml() {
// Parse KML
let path: String = // Path to your KML file...
let kmlUrl = URL(fileURLWithPath: path)
let kmlParser = GMUKmlParser(url: kmlUrl)
kmlParser.parse()
// Render parsed KML
let renderer = GMUGeometryRenderer(
map: mapView,
geometries: kmlParser.placemarks,
styles: kmlParser.styles,
styleMaps: kmlParser.styleMaps
)
renderer.render()
}
You can see more example usages in our sample projects.
- Clone this repository
- Run
carthage update --platform iOS --use-xcframeworks
at the root of the repository - Open the
GoogleMapsUtils.xcodeproj
file on Xcode and run one of the targets
Encounter an issue while using this library?
If you find a bug or have a feature request, please file an issue. Or, if you'd like to contribute, please refer to our contributing guide and our code of conduct.
You can also reach us on our Discord channel.
For more information, check out the detailed guide on the Google Developers site.