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

Unable to apply color style on map #7

Open
deepakrhtsdev opened this issue Dec 22, 2022 · 0 comments
Open

Unable to apply color style on map #7

deepakrhtsdev opened this issue Dec 22, 2022 · 0 comments

Comments

@deepakrhtsdev
Copy link

I'm try to change the color of my swiftui code with below code but not working:

func makeUIView(context: Context) -> GMSMapView {
self.applyColorToMap()
return gmsMapView
}

func applyColorToMap() {
do {
// Set the map style by passing the URL of the local file.
if let styleURL = Bundle.main.url(forResource: "style", withExtension: "json") {
gmsMapView.mapStyle = try GMSMapStyle(contentsOfFileURL: styleURL)
} else {
NSLog("Unable to find style.json")
}
} catch {
NSLog("One or more of the map styles failed to load. (error)")
}

}
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

1 participant