/* Map */
mapView = GMSMapView()
mapView.delegate = self
mapView.mapType = .normal
do {
// Set the map style by passing the URL of the local file.
if let styleURL = Bundle.main.url(forResource: "styles", withExtension: "json") {
mapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
} else {
NSLog("Unable to find styles.json")
}
} catch {
NSLog("One or more of the map styles failed to load. \(error)")
}
Ich folge this Tutorial zum Anpassen meiner Google-Karte.GMSMapView kann nicht angewendet werden
Oben ist mein Code zum Implementieren der Datei styles.json. Ich habe die Datei in meinem Build-Bundle hinzugefügt, und der Code löst niemals eine Ausnahme aus, da ich meine JSON-Datei nicht parsen kann. Es wendet die Style-Effekte einfach nicht auf meine Map an.
Jede Hilfe wäre willkommen. Ich sterbe langsam innerlich !!!
Ihr Link nicht gültig ist sowie überprüfen Sie die .json Datei ist in Bündel Ressource verfügbar ist sonst die möglich Projekt –
den Link Fest befestigen! Aber ich fand die Lösung – user3431429
Das Problem war, dass Google Map Styling nicht für südkoreanisches Gebiet funktioniert. TRAURIG! – user3431429