jduthon / GoogleStaticMapsKit

GoogleStaticMapsKit provide a full swift API for dealing with Google Static Maps API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


GoogleStaticMapsKit


GoogleStaticMapsKit provides a full swift API for dealing with Google Static Maps API.

Getting Started

Example

// Setting up the API Key (probably in AppDelegate)
GoogleStaticMaps.setAPIKey(apiKey: "AIxxxxxxxxxx_gyyyyyyyKyyYyy")

// Configure Parameters
let point = Location(center: .geo(latitude: lat, longitude: long), zoom: .street)
let setting = Parameters(size: CGSize(width: 200, height: 200))
let styles = StyleImport.fromJson(path: jsonPath).styles
let component = Feature(styles: styles)

// Use GoogleStaticMaps Object
let gsm = GoogleStaticMaps(point: point, setting: setting, component: component)

print("Result : \(gsm.toURL)")
self.ibMapsImageView.kf.setImage(with: gsm.toResource)

Style

GoogleStaticMapKit was designed to support JSON Style like SnazzyMaps

For more information about Google Maps Style you can look on the official Google Documentation

Support

  • Location parameters
    • Center by coordinates
    • Center by adress
    • Zoom Level
  • Map parameters
    • Size
    • Scale
    • Format (png/gif/jpg)
    • Map Type (roadmap / satellite / hybrid / terrain)
    • Language
    • Region
  • Feature parameters
    • Markers
    • Path
    • Visible
    • Style
  • Key and Signature parameters
    • Key
    • Signature

Installation

GoogleStaticMapsKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

CocoaPods

use_frameworks!
pod "GoogleStaticMapsKit", '~> 2.0.0'

Carthage

github 'PoissonBallon/GoogleStaticMapsKit'

Author

License

GoogleStaticMapsKit is available under the MIT license. See the LICENSE file for more info.

About

GoogleStaticMapsKit provide a full swift API for dealing with Google Static Maps API

License:MIT License


Languages

Language:Swift 97.1%Language:Ruby 2.9%