1

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

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.

Unzoomed:

enter image description here

Zoomed:

enter image description here

Zoomed after scroll:

enter image description here

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);

}

}

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.

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.

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

mobac screen

and then I click create atlas button.

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

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

Community
  • 1
  • 1
MyWay
  • 1,011
  • 2
  • 14
  • 35
  • You should detail which output format you choose on MOBAC, and the osmdroid version you are using. – MKer Aug 18 '14 at 12:01
  • thx for advice I'm going to update the post right now. If any other details is needed, please give the word – MyWay Aug 18 '14 at 12:24

2 Answers2

1

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

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.

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

Community
  • 1
  • 1
MKer
  • 3,430
  • 1
  • 13
  • 18
  • For all time i put it on the sd card, the solution was look where are cached tiles and put my generated tiles instead of cached ones. There were inside internal store not sd card – MyWay Oct 14 '15 at 17:40
0

Zips and archives should be in /sdcard/osmdroid/ (not in the tiles directory). That's part of the problem.

The 'zoomed in' picture is osmdroid scaling the previous zoom level to fill the screen. This only happens while you're zooming in and is then replaced with the actual tile for that zoom level. The last part isn't happening since it's not loading your tiles.

spy
  • 3,199
  • 1
  • 18
  • 26