show only ground overlays map android?

前端 未结 2 1508
耶瑟儿~
耶瑟儿~ 2021-01-26 03:55

hello I\'m implementing ground overlay in android. Now i want to clear background arround Ground overlay or show only Ground Overlay.

default

相关标签:
2条回答
  • 2021-01-26 04:47

    I know it is an old Thread but it might help someone. Try using a MapStyle JSON string like the one below.

    "[{\"featureType\": \"administrative\",\"stylers\": [{\"visibility\": \"off\"}]},{\"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\"}]}]"

    Swift:

    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)
    

    Creating a Style: https://mapstyle.withgoogle.com

    0 讨论(0)
  • 2021-01-26 04:51

    GoogleMap MapType = MAP_TYPE_NONE

    0 讨论(0)
提交回复
热议问题