ios - 无法将样式应用于 GMSMapView

标签 ios google-maps gmsmapview

我的代码如下:

    /* 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)")
    }

我正在关注 this有关如何自定义我的 Google map 的教程。

以上是我实现 styles.json 文件的代码。我在我的构建包中添加了该文件,并且代码从未抛出关于无法解析我的 json 文件的异常。它根本没有将样式效果应用到我的 map 上。

如有任何帮助,我们将不胜感激。我在里面慢慢地死去!!!

最佳答案

为 future 任何人留下答案:

Google map 样式不适用于韩国 map 。它甚至适用于朝鲜,但不适用于韩国。韩国法律禁止将 map 数据导出到国外数据中心。

source :

Yes , Korea does not support some features offered by Google Map due to national law. Google Map Korea can not be export map data for data centers abroad or including the ability to dynamically change the map image. Many South Korea Maps and services are limited to the domestic uses and Google is striving to make this a better service. For more details here's the original answer in Korean: original reply from Google Maps Korea

关于ios - 无法将样式应用于 GMSMapView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46335889/

相关文章:

ios - 如何在 GMS map 上绘制新标记(带有已绘制的标记)并选择设置?

ios - UIKeyboard 上滑(显示)和下滑(隐藏)动画如何去除? -IOS9 swift

ios - UIImage 遍历像素非常低效?

google-maps - 是否可以使用固定电话号码跟踪谷歌地图位置?

javascript - 更改 map 上的坐标

ios - 将 Google map 相机移动到某个位置

iphone - 如何在我的 iPhone 应用程序中使用信用卡订阅?

ios - root.plist setting.bundle老编辑器,在哪里?

android - 如何在 Android API 级别 9+ 的 MapActivity 中显示兼容性操作栏?

ios - 使用带有标记更新的谷歌地图的随机崩溃