Skip to content

Commit 7805b27

Browse files
committed
updated README
1 parent e888705 commit 7805b27

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Example/MapCache/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class ViewController: UIViewController {
6868
//
6969
extension ViewController : MKMapViewDelegate {
7070
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
71-
7271
return mapView.mapCacheRenderer(forOverlay: overlay)
7372
}
7473
}

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![License](https://img.shields.io/cocoapods/l/MapCache.svg?style=flat)](https://cocoapods.org/pods/MapCache)
99
[![Platform](https://img.shields.io/cocoapods/p/MapCache.svg?style=flat)](https://cocoapods.org/pods/MapCache)
1010

11-
The missing part of MapKit: A simple way to cache data.
11+
The missing part of MapKit: A simple way to cache map tiles.
1212

1313
## Example
1414

@@ -30,7 +30,7 @@ In the view controller where you have the `MKMapView` import `MapCache`
3030
import MapCache
3131
```
3232

33-
Then wihtin the ViewController add
33+
Then within the ViewController add
3434

3535
```swift
3636

@@ -46,11 +46,14 @@ class ViewController: UIViewController {
4646

4747
...
4848

49-
// First setup the your cache
49+
// First setup the your cache
5050
let config = MapCacheConfig(withTileUrlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
5151

52-
// Tell the map to use MapCache with the config
53-
map.useMapCache(withConfig: config)
52+
// initialize the cache with our config
53+
mapCache = MapCache(withConfig: config)
54+
55+
// We tell the MKMapView to use our cache
56+
map.useCache(mapCache!)
5457

5558
...
5659
}
@@ -64,9 +67,10 @@ Finally, tell the map delegate to use mapCacheRenderer
6467
// add this extension:
6568
extension ViewController : MKMapViewDelegate {
6669
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
67-
return mapView.mapCacheRenderer(for: overlay)
70+
return mapView.mapCacheRenderer(forOverlay: overlay)
6871
}
6972
}
73+
7074
```
7175

7276
## Author

0 commit comments

Comments
 (0)