【问题标题】:Osmdroid map blurred in android devicesOsmdroid 地图在 android 设备中模糊
【发布时间】:2018-11-18 16:37:10
【问题描述】:

我正在使用 osmdroid 库在我的应用程序中提供 osm 映射功能。

compile 'org.osmdroid:osmdroid-android:6.0.2'

在功能方面一切正常,但我有一个与地图外观有关的问题。一个网站也正在开发中,用于与应用程序相同的功能,并且在网络中他们也使用 osm 地图。 现在的问题是地图在网站上看起来很清晰,而在 Android 设备上看起来很模糊。

查看附件截图

手机截图

网页截图

以下是我在我的 Android 应用中加载地图的代码。

 binding.map.setTileSource(TileSourceFactory.MAPNIK);
                        binding.map.setTilesScaledToDpi(true);
                        binding.map.setBuiltInZoomControls(false);
                        binding.map.setMultiTouchControls(true);
                        if (gpsTracker.canGetLocation()) {
                            if (gpsTracker.getLocation() != null) {
                                currentLocation = gpsTracker.getLocation();
                                centreLocation = gpsTracker.getLocation();
                                addCurrentLocationMarker(currentLocation);
                                getMarkersInCurrentLocation(currentLocation);
                            } else {
                                gpsTracker.showSettingsAlert();
                            }

                        } else {
                            gpsTracker.showSettingsAlert();
                            //Toast.makeText(getApplicationContext(), "Unable to get current location", Toast.LENGTH_LONG).show();
                        }

这与我使用的磁贴源有关吗?

【问题讨论】:

    标签: android openstreetmap osmdroid


    【解决方案1】:

    这是由于 binding.map.setTilesScaledToDpi(true) 会根据您的设备分辨率缩放图块。 尝试不使用:图像会很干净,但标签应该太小,可读性差。

    AFAIK,目前还没有好的解决方案:OpenStreetMap 图块在当前移动设备的分辨率下不可用。

    -- 编辑 2018 年 12 月 12 日-- 见https://github.com/osmdroid/osmdroid/issues/1217

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-05
      • 2014-07-28
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多