GoogleMapsTileOverlay lets you customize Apple Maps MKMapView with the Google Maps StylingWizard.
Add this line to your depedencies in Package.swift
.package("https://github.com/thepeaklab/GoogleMapsTileOverlay", from: "0.5.0")
To install GoogleMapsTileOverlay
with Carthage, setup Carthage for your project as described in the Quick Start.
Then add this line to your Cartfile:
github "thepeaklab/GoogleMapsTileOverlay" ~> 0.4.1
Install CocoaPods if you haven't already
Add this in your Podfile
for your target:
pod 'GoogleMapsTileOverlay', '~> 0.4.1'
And install with:
pod install
You can customize Apple Maps to match the design of your App or Game:
- Create MapStyle with the Google Maps StylingWizard and save it to a JSON-File
- Add JSON-File to your XCode Project
- In your ViewController:
import GoogleMapsTileOverlay
guard let jsonURL = Bundle.main.url(forResource: "MapStyle", withExtension: "json") else { return }
let tileOverlay = try? GoogleMapsTileOverlay(jsonURL: jsonURL)
tileOverlay.canReplaceMapContent = true
mapView.addOverlay(tileOverlay, level: .aboveRoads)
mapView.delegate = self
extension YourViewController: MKMapViewDelegate {
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
if let tileOverlay = overlay as? MKTileOverlay {
return MKTileOverlayRenderer(tileOverlay: tileOverlay)
}
return MKOverlayRenderer(overlay: overlay)
}
}
- Labels in iOS 13 On iOS 13 the labels on the map and the annotations are not visible, even when using the level aboveRoads. This bug is already reported to Apple and will hopefully be solved in future versions of iOS.
Please submit an issue on GitHub.
This project is licensed under the terms of the MIT license. See the LICENSE file.