这是indexloc提供的服务,不要输入任何密码
Skip to content

googlemaps/google-maps-ios-utils

Repository files navigation

Run unit tests pod GitHub contributors Apache-2.0

Google Maps SDK for iOS Utility Library

Description

This open-source library contains classes that are useful for a wide range of applications using the Google Maps SDK for iOS.

Requirements

Installation

In your Podfile:

use_frameworks!

target 'TARGET_NAME' do
    pod 'Google-Maps-iOS-Utils', '4.2.0'
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.0")
  )
]
Only supported if using Maps SDK v4.2.0 or earlier

In your Cartfile:

github "googlemaps/google-maps-ios-utils" ~> 4.2.0

See the Carthage doc for further installation instructions.

In addition to this, you will also have to include the GoogleMaps dependency using one of the available installation options (CocoaPods, XCFramework, Carthage (for v4.2.0 and earlier) or manual).

Sample App

See the README for the Swift and Objective-C samples apps in /samples.

Documentation

Read documentation about this utility library on developers.google.com or within the /docs directory.

Usage

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()
}

Contributing

Contributions are welcome and encouraged. Please see the contributing guide for guidance.

Support

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.