只显示地面覆盖地图android?

时间:2014-10-08 06:30:04

标签: android google-maps

你好我正在android中实现地面叠加。现在我想清除地面覆盖背景或仅显示地面覆盖。

默认 enter image description here

现在我想要 enter image description here

那么代码如何?

2 个答案:

答案 0 :(得分:1)

GoogleMap MapType = MAP_TYPE_NONE

答案 1 :(得分:0)

我知道这是一个旧的线程,但它可能会对某人有所帮助。尝试使用下面的MapStyle JSON字符串。

“ [{{\” featureType \“:\”行政\“,\”样式器\“:[{\”可见性“:\”关闭\“}]},{\” featureType \“:\” landscape \“,\” elementType \“:\” geometry.fill \“,\” stylers \“:[{\” color \“:\”#e0fbc6 \“}]}},{\” featureType \“:\ “ poi \”,\“ stylers \”:[{\“ visibility \”:\“ off \”}]}},{\“ featureType \”:\“ poi \”,\“ elementType \”:\“ labels .icon \“,\” stylers \“:[{\” visibility \“:\” off \“}]} ,, {\” featureType \“:\” poi \“,\” elementType \“:\” labels .text \“,\” stylers \“:[{\” visibility \“:\” off \“}]}},{\” featureType \“:\” road \“,\” stylers \“:[{\ “ visibility \”:\“ off \”}]},{\“ featureType \”:\“ transit \”,\“ stylers \”:[{\“ visibility \”:\“ off \”}]}, {\“ featureType \”:\“ water \”,\“ elementType \”:\“ labels.text \”,\“ stylers \”:[{\“ visibility \”:\“ off \”}]}] “

迅速:

do {
     // Set the map style by passing a valid JSON string.
     mapView.mapStyle = try GMSMapStyle(jsonString: mapStyleString)
} catch {
     NSLog("One or more of the map styles failed to load. \(error)")
}

Android:

map.setMapStyle(MapStyleOptions(JSON_STYLE_MAP)

创建样式: https://mapstyle.withgoogle.com