在iOS中更改GMSMapView默认地图背景颜色 [英] Change GMSMapView default map background color in iOS

查看:432
本文介绍了在iOS中更改GMSMapView默认地图背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS中的GMSMapView具有tan的默认背景色,或类似的东西。

The GMSMapView in iOS has a default background color of tan, or something like it.

我有要求将该颜色更改为白色。我试过使用GMSTileLayer的子类而没有成功(或错误)。我需要将具有白色背景的自定义地图叠加到地图视图上。在没有叠加的区域,底图颜色需要匹配(白色)。

I have a requirement to change that color to white. I've tried using a subclass of GMSTileLayer without success (or errors). I need to place custom map overlays with white backgrounds onto the map view. In areas without the overlays, the base map color needs to match (white).

尝试以下方法没有任何运气:

Tried the following without any luck:

[mapView setBackgroundColor:[UIColor whiteColor]];

任何人都可以提供建议,或者将我指向可能有帮助的资源(Google除外)。

Can anyone offer suggestions, or point me to a resource (other than Google) that might help?

谢谢!

Thanks!

推荐答案

现在您可以更改您的GMSMapStyle地图(适用于iOS 2.1的Google Maps SDK)。
样式仅适用于kGMSTypeNormal地图类型。
我使用 https://mapstyle.withgoogle.com/
创建自己的风格希望它能帮助你。

Now you can change GMSMapStyle of you map (available with Google Maps SDK for iOS 2.1). Styling works only on the kGMSTypeNormal map type. I create my own style with https://mapstyle.withgoogle.com/ Hope, it will help you.

这篇关于在iOS中更改GMSMapView默认地图背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆