GoogleStaticMapsKit provides a full swift API for dealing with Google Static Maps API.
// 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)
GoogleStaticMapKit was designed to support JSON Style like SnazzyMaps
For more information about Google Maps Style you can look on the official Google Documentation
- 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
GoogleStaticMapsKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
pod "GoogleStaticMapsKit", '~> 2.0.0'
github 'PoissonBallon/GoogleStaticMapsKit'
- PoissonBallon @poissonballon
GoogleStaticMapsKit is available under the MIT license. See the LICENSE file for more info.