athenalyn / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

zoom-in zoom-out in offline mode in osmdroid-android-3.0.7.jar #332

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download the map in a Mapnik zip file with mobac an store them as zip-file 
on the SD-card
2. Set the zoom level on the map to 16 when launched
3. Zoom in and zoom out by pinching the map or the build-in zoom controls

What is the expected output? What do you see instead?
expected result: smooth zooming the map and rendering the map tiles correctly

actual result: map tiles are sometimes rendered correctly, but in most cases 
the tiles are not rendered very well and smoothly (zoom-in) or there are 
multiple of gray tiles in the middle of the map (zoom-out)

What version of the product are you using? On what operating system?
product version: 3.0.7 jar
android sdk version: r17
operating system: Mac OS X Lion 10.7.3 (Emulator with all Android API levels 
starting from 2.1)
device: Samsung Galaxy S II with Android 2.3.3, Sony Ericsson Xperia X10 Mini 
Pro with Android 2.3.7 (miniCyanogenmod 7)

Please provide any additional information below.
Tested on device and multiple simulators and downloaded multiple map tiles from 
different city's with mobac.
The issue it doesn't render correctly or having gray tiles seems be on every 
location and random on your map when you are zooming in offline mode. I've find 
out it doesn't happen when I allow connection to the internet. In osmdroid 
3.0.5 it's working correctly for offline mode.

Original issue reported on code.google.com by sam.w...@gmail.com on 5 Apr 2012 at 8:47

GoogleCodeExporter commented 8 years ago
I had the same problem but I change to 
osmdroid-android-3.0.8-20120208.220818-1.jar
and it seems to work fine, when zoom in some maps tiles are updated and some 
parts of the map remain as it is and I think this is because the tiles 
crosponding to the partsof the map(not updated)  are not downloaded because in 
mobile atlas

Original comment by 07n...@gmail.com on 20 Apr 2012 at 8:12

GoogleCodeExporter commented 8 years ago
I have attached a quick and dirty patch to solve the problem. Basically I had 
to disable the ScaleTileLooper in class  MapTileProviderBase.
In my project I have both online and offline maps, so I switch the behavior 
with a setter:

MapTileProviderArray provider = new MapTileProviderArray(MBTILESRENDER, null, 
new MapTileModuleProviderBase[] { moduleProvider });
provider.setUseScaleTileLooper(false);
...

Original comment by markgabb...@gmail.com on 16 May 2012 at 10:31

Attachments:

GoogleCodeExporter commented 8 years ago
Is this different to issue 290 and issue 289?

Original comment by neilboyd on 17 May 2012 at 2:16

GoogleCodeExporter commented 8 years ago
It looks the same as both issue 290 and issue 289. The patch does improve 
things a bit, as it gets rid of some overhead on zooming in/out. And yet, 
missing tiles are still there, especially on zoom out (library v.4.1). The 
problem seems to be a timeout of some kind. The slower the loading, the more 
missing tiles there is. I tested it on a customized version of GEMFFileArchive 
(which supports overzoom and caches overzoomed tiles). The original 
GEMFFileArchive is obviously faster and I get less missing tiles, but still 
occasionally do. And by the way, the tiles are in TileOverlay.
Does it give any clue as to where the timeout is happening? 

Original comment by daniel.k...@gmail.com on 10 May 2014 at 3:43

GoogleCodeExporter commented 8 years ago
I finally solved the problem by following the advice from issue 251 - by 
setting TileRequestCompleteHandler for provider for tile overlay to MapView's 
one. Like so:

myGemfTileProvider.setTileRequestCompleteHandler(mMapView.getTileRequestComplete
Handler());

Original comment by daniel.k...@gmail.com on 10 May 2014 at 4:12

GoogleCodeExporter commented 8 years ago
@daniel.klimov I would appreciate it if you could create a new issue in github 
which can replace all the related issues. Then we can consolidate all the 
relevant information and close the rest.

Original comment by neilboyd on 13 May 2014 at 7:43