Contents

poissonballon/googlestaticmapskit

GoogleStaticMapsKit

Preview

<img src="Assets/record.gif" alt="record" width="300"/>

Zoom

<table border="1" cellpadding="5">

<tr>

<td align="center" valign="center"> <img src="Assets/example/zoom-world.png" alt="zoom-world" width="200"/> <br /> Zoom : .world </td>

<td align="center" valign="center"> <img src="Assets/example/zoom-continant.png" alt="zoom-continant" width="200"/> <br /> Zoom : .continent </td>

<td align="center" valign="center"> <img src="Assets/example/zoom-city.png" alt="zoom-city" width="200"/> <br /> Zoom : .city </td>

<td align="center" valign="center"> <img src="Assets/example/zoom-street.png" alt="zoom-street" width="200"/> <br /> Zoom : .street </td>

<td align="center" valign="center"> <img src="Assets/example/zoom-building.png" alt="zoom-building" width="200"/> <br /> Zoom : .building </td>

</tr>

</table>

Style

<table border="1" cellpadding="5">

<tr>

<td align="center" valign="center"> <img src="Assets/example/style-retro.png" alt="style-retro" width="200"/> <br /> <a href="https://snazzymaps.com/style/18/retro">Style : [Retro]</a> </td>

<td align="center" valign="center"> <img src="Assets/example/style-assasins-creed.png" alt="style-assasins" width="200"/> <br /> <a href="https://snazzymaps.com/style/72543/assassins-creed-iv">Style : [Assassin's Creed IV]</a> </td>

<td align="center" valign="center"> <img src="Assets/example/style-lost-in-the-desert.png" alt="style-lost-in-the-desert" width="200"/> <br /> <a href="https://snazzymaps.com/style/93/lost-in-the-desert">Style : [Lost in the desert]</a> </td>

<td align="center" valign="center"> <img src="Assets/example/style-wy.png" alt="style-wy" width="200"/> <br /> <a href="https://snazzymaps.com/style/8097/wy">Style : [WY]</a> </td>

</tr>

</table>

Getting Started

Example

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


let parameters = Parameters(size: ImageSize(width: 600, height: 400))
let location = Location(center: .geo(latitude: 45.7772, longitude: 3.0870), zoom: .city)
let gsm = GoogleStaticMaps(location: location, parameters: parameters)

let url = gsm.toURL

print("Result : \(url)")

Style

GoogleStaticMapKit was designed to support JSON Style like SnazzyMaps

[...]
let path = jsonFilePath
let styles = StylesImporter.fromJson(path: path).styles
let feature = Feature(styles: styles)
let gsm = GoogleStaticMaps(location: location, parameters: parameters, feature: feature)

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

Support

  • Location parameters

[x] Center by coordinates [x] Center by adress * [x] Zoom Level

  • Map parameters

[x] Size [x] Scale [x] Format (png/gif/jpg) [x] Map Type (roadmap / satellite / hybrid / terrain) [x] Language [x] Region

  • Feature parameters

[x] Markers [ ] Path [ ] Visible [x] Style

  • Key and Signature parameters

[x] Key [ ] Signature

Installation

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

CocoaPods
use_frameworks!
pod "GoogleStaticMapsKit"
Carthage
github 'PoissonBallon/GoogleStaticMapsKit'
Swift Package Manager
let package = Package(
    name: "MyPackage",
    dependencies: [
        .Package(url: "https://github.com/PoissonBallon/GoogleStaticMapsKit", majorVersion: 1),
    ]
)

Author

License

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

Package Metadata

Repository: poissonballon/googlestaticmapskit

Default branch: master

README: README.md