Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapKitGoogleStyler no longer working #10

Open
ajaymerchia opened this issue Dec 30, 2018 · 3 comments
Open

MapKitGoogleStyler no longer working #10

ajaymerchia opened this issue Dec 30, 2018 · 3 comments

Comments

@ajaymerchia
Copy link

Can anyone confirm that this library is no longer functioning -- perhaps Apple restricted usage of tileOverlays for this purpose.

I call the following in viewDidLoad

//  LayoutManager is a custom library that I wrote, it successfully places the MapView onscreen
        mapView = MKMapView(frame: LayoutManager.between(elementAbove: roundName, elementBelow: selectTeamButton, width: view.frame.width, topPadding: 2 * .MARGINAL_PADDING, bottomPadding: .PADDING))
        mapView.delegate = self
        mapView.showsUserLocation = true
        mapView.setUserTrackingMode(.follow, animated: true)
        view.addSubview(mapView)
        restyleMap()

Where restyleMap contains

guard let overlayFileURLString = Bundle.main.path(forResource: "overlay", ofType: "json") else {
            return
        }
        let overlayFileURL = URL(fileURLWithPath: overlayFileURLString)
        debugPrint(overlayFileURL)
        // After that, you can create the tile overlay using MapKitGoogleStyler
        guard let tileOverlay = try? MapKitGoogleStyler.buildOverlay(with: overlayFileURL) else {
            return
        }
        // And finally add it to your MKMapView
        mapView.delegate = self
        mapView.addOverlay(tileOverlay, level: .aboveLabels)
        debugPrint(mapView.overlays)

I can confirm that the overlay is added to the map, but the dark style JSON doesn't load. I put a breakpoint inside the func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer function, but the function isn't getting called.

Any thoughts on why this might be happening? Is the renderer returned without the necessary attributes to make the map load it?

@JohLud
Copy link

JohLud commented Jan 3, 2019

Yes you're right same problem here.

@3vangelos
Copy link

3vangelos commented Apr 3, 2019

Hey @fmo91, thanks for this lib, I am actually also facing this problem right now. Any plans on releasing a new version any time soon?

@LinusGeffarth
Copy link

Works fine for me in iOS 13.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants