作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
需要有关Google map sdk主题的帮助。
我已经使用JSON文件名style2.json来调用google map的夜间模式。
主题已从标准模式正确更改为夜间模式。唯一的问题是,我想使用所有地标将“夜间模式” map 重新转换为标准 map 主题。
请找到随附的代码
do {
// Set the map style by passing the URL of the local file.
if let styleURL = Bundle.main.url(forResource: "style2", withExtension: "json") {
self.myMapView.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)")
}
最佳答案
您可以通过在夜间模式未开启时打印其值来了解标准/默认mapStyle
是什么。
我正是这样做的,发现它是nil
,所以您只需要将其设置为nil
即可:
self.myMapView.mapStyle = nil
关于ios - 如何在单击按钮时快速将Google Map的主题从夜间模式更改为标准模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60336238/
我的应用程序使用 Theme.AppCompat.DayNight.NoActionBar AppTheme ,并有一个抽屉导航。我所有的可绘制对象都是 XML 向量,其中的路径是黑色的。对于在我的
我正在使用 Angularjs 开发一个应用程序。我对动画的一个问题感到震惊。 我想将此处以两种模式(夜间和白天模式)显示的方式添加到我的应用程序中。我看到每次更改模式时都可以使用主题提供程序来更改主
我的客户希望在他的应用程序的“设置” View 中有一个 UISwitch 控件,即:“夜间禁用通知”。如果此选项已打开并且现在是晚上,他希望推送他的 API 将发送到移动设备的消息被忽略。这可能吗?
我是一名优秀的程序员,十分优秀!