osmdroid - 离线地图,没有显示滚动缩放地图后,地图 [英] osmdroid - offline map, not showing map after scrolling zoomed map

查看:1168
本文介绍了osmdroid - 离线地图,没有显示滚动缩放地图后,地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题显示离线地图。我使用osmdroid +瓷砖通过MOBAC下载并推了电话。

I have some problems with showing map in the offline map. I'm using osmdroid + tile downloaded via MOBAC and putted on the phone.

我下载的特定区域内的地砖,我可以看到未缩放的地图,似乎一切ok了我。然后,我缩放地图,看起来确定,但如果当时我滚动我看到地图的卸载片段。
该屏幕应该显示我的意思。

I download the tiles from particular area, I can see unzoomed map, everything seems ok for me. Then I zoom the map and looks ok but if I scroll then I see unloaded fragments of map. This screen should show what I meant.

未缩放:

缩放:

滚动缩放后:

和这里是我的code:

and here is my code:

public class OSMDroidMapActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) 
{
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    MapView mapView = new MapView(this,256);

    //mapView.setClickable(true);

    mapView.setBuiltInZoomControls(true);

    setContentView(mapView);

    // set initial zoom-level
    mapView.getController().setZoom(15);
    mapView.setMultiTouchControls(true);
    mapView.setClickable(true);

    mapView.getController().setCenter(new GeoPoint(54.178181,15.579021));
    //keeps the mapView from loading online tiles using network connection.
    mapView.setUseDataConnection(false);    
    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);

}

}

有没有任何选项强制视图渲染一次或不服这样。这不是没有在手机的内存瓷砖的问题,因为当我取消缩放地图,然后放大该片段其中U可以在滚动缩放后的看屏幕,地图显示正常。在我看来,这是通过绘制地图的小片段,当我放大它引起的。

Is there any option to force view to render one more time or smth like that. This is not problem of not having the tiles in the memory of phone, cause when I unzoom map and then zoom this fragment which u can see at "Zoomed after scroll:" screen, the map is showed properly. In my opinion this is caused by rendering small fragment of map when I zoom it.

我寻找答案,大多数问题都是关于形势的时候地图是不是在所有(问题砖)显示。我发现<一个href=\"http://stackoverflow.com/questions/10034404/osmdroid-offline-mode-update-tiles-after-zoom\">this的问题,但jar文件的变化版本地图只造成更多的问题。

I searched for answer, most of question are about situation when map isn't showed at all(problem with tiles). I found this question, but changing version of jar file caused only more problem with map.

编辑:
附加信息:
对于osmdroid我使用这个lib中jar文件:osmdroid-Android的4.2.jar,这里是从MOBAC屏幕

Additional info: for osmdroid I'm using this lib jar file: osmdroid-android-4.2.jar and here is the screen from MOBAC

然后我点击创建按钮,图册。

and then I click create atlas button.

路径瓷砖:
SD卡\\ osmdroid \\瓷砖\\ MapQuest的

Path to tiles: SD Card\osmdroid\tiles\MapQuest

瓷砖是阿特拉斯创建为输出MOBAC RAR文件

tiles is the rar file which is atlas created as output from mobac

推荐答案

由于osmdroid 4.2,MapQuestOSM瓷砖源的默认格式是JPG。所以,你的转换PNG是没有必要的。
编辑 - 这可能是你的问题的一部分。
请参阅这篇文章:<一href=\"http://stackoverflow.com/questions/22862534/download-maps-for-osmdroid/22868462#22868462\">Download地图osmdroid

Since osmdroid 4.2, the default format of MapQuestOSM tile source is "jpg". So your conversion to png is not necessary. EDIT - And this could be a part of your issue. Refer to this post: Download maps for osmdroid

你有SD卡\\ osmdroid \\瓦子显示目录\\ MapQuest的,或者这个目录完全是空的?如果不是空的,显示的瓷砖可能来自这个缓存,而不是从你的zip文件。这可以解释的行为(在所有未使用zip文件,使用时可用缓存切片)。要100%地肯定:如果它不是空的,将其删除。

Do you have sub-dirs in SD Card\osmdroid\tiles\MapQuest, or is this directory COMPLETELY empty? If it's not empty, the tiles displayed could come from this cache, not from your zip file. This could explain the behaviour (zip file not used at all, cached tiles used when available). To be 100% sure: if it's not empty, delete it.

和你能不能还你的设备上精确地指定您MOBAC zip文件的完整路径的位置?

And could you also specify exactly the full path location of your MOBAC zip file on your device?

这篇关于osmdroid - 离线地图,没有显示滚动缩放地图后,地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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