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 13.0+
- Maps SDK for iOS (see Releases for minimum compatible version)
-
Include the
GoogleMaps
dependency using one of the available installation options (CocoaPods, XCFramework, Carthage (for v6.2.1 and earlier) or manual). -
Add this utility library using one of the methods below:
In your Podfile
:
use_frameworks!
target 'TARGET_NAME' do
pod 'Google-Maps-iOS-Utils', '4.2.2'
end
Replace TARGET_NAME
and then, in the Podfile
directory, type:
pod install
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.2.2")
)
]
Only supported if using Maps SDK v6.2.1 or earlier
In your Cartfile
:
github "googlemaps/google-maps-ios-utils" ~> 4.1.0
See the Carthage doc for further installation instructions.
See the README for the Swift and Objective-C samples apps in /samples.
Read documentation about this utility library on developers.google.com or within the /docs directory.
import GoogleMaps
import GoogleMapsUtils
class MarkerClustering: UIViewController, GMSMapViewDelegate {
private var mapView: GMSMapView!
private var clusterManager: GMUClusterManager!
override func viewDidLoad() {
super.viewDidLoad()
// Set up the cluster manager with the supplied icon generator and
// renderer.
let iconGenerator = GMUDefaultClusterIconGenerator()
let algorithm = GMUNonHierarchicalDistanceBasedAlgorithm()
let renderer = GMUDefaultClusterRenderer(mapView: mapView,
clusterIconGenerator: iconGenerator)
clusterManager = GMUClusterManager(map: mapView, algorithm: algorithm,
renderer: renderer)
// Register self to listen to GMSMapViewDelegate events.
clusterManager.setMapDelegate(self)
// ...
}
// ...
}
let markerArray = [marker1, marker2, marker3, marker4] // define your own markers
clusterManager.add(markerArray)
clusterManager.cluster()
import GoogleMaps
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()
}
Contributions are welcome and encouraged. Please see the contributing guide for guidance.
This library is offered via an open source license. It is not governed by the Google Maps Platform Support Technical Support Services Guidelines, the SLA, or the Deprecation Policy (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).
This library adheres to semantic versioning to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.
If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels such as our Discord server.
google-maps-ios-utils's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.