Latest 0.2.0
License MIT
Platforms ios 8.0, requires ARC
Dependencies PINCache
Frameworks UIKit, MapKit, CoreLocation

[![CI Status]( Smith/MapSnap.svg?style=flat)]( Smith/MapSnap)


MapSnap requires at least iOS 8 and Swift 3.0


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

pod "MapSnap"


UIImageView extensions to generate, cache, and set a map image based on a CLLocationCoordinate2D

let mapImageView = UIImageView(frame: .zero)
let latitude = 42.3601
let longitude = 71.0589
let coordinate = CLLocationCoordinate2D(latitude: latitude, longitude: longitude)
mapImageView.setMapImage(with: coordinate)

Optionally specify:

  • image size
  • placeholder image to use while the map image is asynchronously generated
let size = CGSizeMake(width: UIScreen.main.bounds.width, height: 200.0)
let placeholderImage = UIImage(named: "my_placeholder_image")
mapImageView.setMapImage(with: coordinate, size: size, placeholderImage: placeholderImage)

MapSnapManager may be used directly to generate and cache map images. The default image size is customizable and has a default value of:

public var defaultImageSize = CGSize(width: UIScreen.main.bounds.width, height: 150.0)

The default cache used is PINCache, but you can subsitute it with anything that conforms to the MapSnapCache protocol:

public protocol MapSnapCache {
    func object(for key: String) -> Any?
    func set(object: NSCoding, for key: String)


Brad Smith, @bsmithers11


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

Latest podspec

    "name": "MapSnap",
    "version": "0.2.0",
    "summary": "A library to easily create map snapshots",
    "description": "MapSnap lets you easily create map snapshots, cache them, and display them in UIImageViews",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Brad Smith": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.0"
    "platforms": {
        "ios": "8.0"
    "source_files": "MapSnap/Classes/**/*",
    "requires_arc": true,
    "frameworks": [
    "dependencies": {
        "PINCache": [
            "~> 2.3"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This