rksahu1987 / osmdroid

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

Mapview not loading after setting max zoom(Offline) #458

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.initiate map view 
      private CustomMapView                          mOsmv;
      mapPreference = DatabaseManager.getInstance().getMapPreferences();
      this.mOsmv = new CustomMapView(this, 256, myResourceProxy, mapPreference);
      this.mLocationOverlay = new MyCustomLocationOverlay(this, this.mOsmv, myResourceProxy, mapPreference);
      mLocationOverlay.start();
      this.mOsmv.setBuiltInZoomControls(false);
      this.mOsmv.setMultiTouchControls(true);
      this.mOsmv.setUseDataConnection(false);
      this.mOsmv.setMaxZoomLevel(mapPreference.getMaxZoom());

2.if we remove the last line setmaxzoomlevel mapview loads fine

What is the expected output? What do you see instead?

-->we want to restrict user to our tiles ..if we have tiles for zoom level 17 
..the user should not able to zoom above that.if we do not set max zoom the 
user can zoom till level 22 ..for which we do not have tiles

-->we see blank mapview and load tiles fails

What version of the product are you using? On what operating system?
-->we are using osmdroid 3.0.10,Windows

Please provide any additional information below.
-->setMaxZoomLevel as we can understand will restrict the mapview to this zoom 
level 

Original issue reported on code.google.com by uditvishnoi2@gmail.com on 1 Aug 2013 at 12:58

GoogleCodeExporter commented 8 years ago
You are going to have to post what you are doing in your CustomMapView - 
particularly how you are setting up your offline tile providers.

Original comment by kurtzm...@gmail.com on 1 Aug 2013 at 1:27

GoogleCodeExporter commented 8 years ago
i guess we are not doing too much with the custom map view..we are loading 
tiles from zip file..
it loads fine when we are not using setmaxzoom..i am attaching custom map view 
with this ..thanx for that early resonse:)

Original comment by uditvishnoi2@gmail.com on 1 Aug 2013 at 3:04

Attachments:

GoogleCodeExporter commented 8 years ago
I tried your custom map view but could not reproduce your problem. Please take 
a look at the sample application which demonstrates this functionality and try 
to isolate what is different with your code.

Again, if you post the code you are using to set up your offline tile providers 
then that would probably help.

Original comment by kurtzm...@gmail.com on 2 Aug 2013 at 2:14

GoogleCodeExporter commented 8 years ago
Hello kurtz, we are using your tile provider array , i am attaching the same 
with this,and can you provide me the sample application  link which you have 
stated above,thanx :)

Original comment by uditvishnoi2@gmail.com on 2 Aug 2013 at 4:45

Attachments:

GoogleCodeExporter commented 8 years ago
1. For off line tile provider we are using zipped file of tiles and putting 
that in osmdroid directory.
2. We have not changed anything in the osmdroid code (using the jar file 3.0.10)
3. The zip contains the tiles till zoom level 17.
4. Thats why we are trying to set max zoom level to 17 using setMaxZoomLevel 
API introduced recently.
5 When we do that, the tiles disappear because then it tries to seek the tiles 
for different x and y (compared to those when we do not use this API )
6. When we dont call this API then the values of x and y are correct and the 
tiles are picked up from the zip file.

Thanx 

Original comment by uditvishnoi2@gmail.com on 2 Aug 2013 at 6:01

GoogleCodeExporter commented 8 years ago
What value is mapPreference.getMaxZoom() returning?

The sample application can be found in SVN at trunk/OpenStreetMapViewer.

Original comment by kurtzm...@gmail.com on 2 Aug 2013 at 1:45

GoogleCodeExporter commented 8 years ago
..Mapreference getmaxzoom returns 17...that is upto whicj we have tiles 
available

Original comment by uditvishnoi2@gmail.com on 2 Aug 2013 at 3:42