anasrp08 / osmdroid

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

Enhancements for offline maps : offset for zoomLevel ; restricted bounding boxes #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi guys,

I'm just beginning on GIS stuff so I think I won't be able (or quite 
unefficiently!) to make some enhancement on this field !
That's why I dare to suggest some dreams I have... 

- When creating offline maps we can specify the zoom level to start with.
Thus, my minimal zoom level will be 13 for example.
However, providing a minimal zoom when creating an ITileSource instances does 
not take this into accounts. It may suppose my files will be formatted like if 
I was starting from zoom level 0. (My minimal level 13 zoom is supposed to be 
composed of 1 tile not 2^12 as it seems to be thinking).

- Second feature request: be able to restrict browsing / loading to a specific 
extent.

I may come up some days with patches but I guess It will take some time :'(

Thanks again for your attention,
Cheers,
Simon Thépot

Original issue reported on code.google.com by simon.th...@gmail.com on 14 Jan 2011 at 3:50

GoogleCodeExporter commented 9 years ago

Original comment by neilboyd on 15 Jan 2011 at 9:23

GoogleCodeExporter commented 9 years ago
Simon,

By creating a custom tile source (ITileSource) you can specify what the minimum 
and maximum zoom levels are for the tile source. This will restrict both the 
minimum and maximum allowed zoom levels. The max/min levels can be fixed at 
compile time, or you can make them configurable at run-time with getters and 
setters. If you are using offline map tiles, then the place to start would be 
BitmapTileSourceBase which accepts a minimum and maximum zoom level as part of 
the constructor.

Does that work for you?

Original comment by kurtzm...@gmail.com on 20 Jan 2011 at 5:11

GoogleCodeExporter commented 9 years ago
In fact, I was not refering to a custom tile source, but indeed to a child 
class of BitMapTileSourceBase I created. This is what I went through before 
submitting my post (did not try again yet).
(public class MyFileSystemSource extends BitmapTileSourceBase {...}).

As I told in my post, the fact is that using offline map ({Z}/{X}/{Y}) does not 
work, if you generated this map with your first zoom as not being zero.
Eg: if I generate my offline starting from zoom level 5, there is only ONE tile 
for this level. But it seems it is not taken into accounts. I guess, the 
software think 2^6 tiles have been generated for this level.

Regards,
Simon Thépot

Original comment by simon.th...@gmail.com on 20 Jan 2011 at 8:39

GoogleCodeExporter commented 9 years ago
Simon,

I think I misunderstood - is this a bug with the osmdroid library or with the 
OSMMapTilePackager?

Original comment by kurtzm...@gmail.com on 21 Jan 2011 at 2:57

GoogleCodeExporter commented 9 years ago
Hello everyone, 

I believe I'm facing the same error. I'm trying to use only offline maps 
initialized with 15 zoom level. This is what I'm doing:
 - I extended BitmapTileSourceBase in order to override getTileRelativeFilenameString() and configure zoomMinLevel. 
 - Also extended MapTileProviderArray adding a new instance of MapTileFilesystemProvider (assigning the previous tile source) to mTileProviderList and setting setUseDataConnection(false). 

But, when I start the application, the following happens:
 - Initial zoom level is 0
 - The tile source doesn't get the pathBase I set. 
 - The API seems to keep downloading tiles from internet.

Am I doing something wrong or this is an unsolved bug?

I would really apreciate your help!!
Thank you very much!
Regards,
Magalí.-

Original comment by maltam...@gmail.com on 28 Jan 2011 at 3:33

GoogleCodeExporter commented 9 years ago
Magali - are you extending MapTileProviderArray or MapTileProviderBasic? If 
MapTileProviderArray, are you adding a MapTileDownloader to the chain? If not, 
then I am not sure how tiles are being actively downloaded.

Also, do you have an SD card installed? Is that where your tiles are located?

Finally, could you give me the full path to one of your map tiles? Does it end 
in .jpg or does it end in .jpg.tile ?

Original comment by kurtzm...@gmail.com on 30 Jan 2011 at 3:33

GoogleCodeExporter commented 9 years ago
- I'm extending MapTileProviderArray and I didn't add any MapTileDownloader, 
may it be taking a default configuration? Because it seems to keep downloading 
tiles. 

- My SD card, yes, it is installed. Tiles are located there.

- A full path: osmdroid/tiles/myApp/15/11062/19736.png.tile

I'm pretty sure that my problem is related with misconfiguration, I'll keep 
seeking and testing. 

Original comment by maltam...@gmail.com on 4 Feb 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Since this is confusing two issues in one, let's restrict this to the first one 
and continue the second in issue 209.

Original comment by neilboyd on 28 Apr 2011 at 5:19

GoogleCodeExporter commented 9 years ago
I don't think this ticket is going anywhere so we can close it.

Original comment by kurtzm...@gmail.com on 2 May 2013 at 12:58