android - 如何在 android 中显示没有标签或街道名称的谷歌地图?

标签 android google-maps

我正在开发一个 Android 应用程序,其中的 map 应该是干净的,并且不能显示街道名称或地点名称。我想使用不同位置的样式和设置优惠来自定义 map 布局。

最佳答案

from this site you can create custom map style

when you get on map ready callback you can set the custom map style like this

  @Override
    public void onMapReady(GoogleMap googleMap) {

        try {
            // Customise the styling of the base map using a JSON object defined
            // in a raw resource file.
            boolean success = googleMap.setMapStyle(
                    MapStyleOptions.loadRawResourceStyle(
                            this, R.raw.style_json));

            if (!success) {
                Log.e(TAG, "Style parsing failed.");
            }
        } catch (Resources.NotFoundException e) {
            Log.e(TAG, "Can't find style. Error: ", e);
        }

    }

关于android - 如何在 android 中显示没有标签或街道名称的谷歌地图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55468130/

相关文章:

android - 如何检查网络和 WI-FI 可用性

java - 动态添加项目到ListView

google-maps - 转换 google.maps.Point 中的 (x, y) 像素坐标

Javascript 和谷歌地图 API

android - android中找不到资源异常

java - Android arraylist<String> 转为单个字符串

javascript - 从最近的标记绘制到用户定义地点的方向

java - 不可转换的类型无法转换

javascript - "google is not defined"在 Chrome 中调用 google map api 时出错

android - 如何在android中使用整数验证edittext?