Android OSM droid - set Max Zoom level
Asked Answered
B

2

7

I am implementing App vith usage of osmdroid mapView. We have maps with max 16 zoom level, but Android allow us to have 18 zoom levels. Do you know how to set maximum zoom level 16 instead of default 18?

Thanks

Hmyzak

Belak answered 21/7, 2011 at 8:51 Comment(0)
K
7

Update - we have added simple setMin/MaxZoomLevel() methods to MapView in the trunk. It should be included in 3.0.10.

See https://code.google.com/p/osmdroid/issues/detail?id=418 for additional info.

Original answer:

Create your own TileSource class and use that. You can piggyback on one of the concrete tile source classes, like:

public static final OnlineTileSourceBase MyMapTileSource = new XYTileSource("My Tile Source",ResourceProxy.string.mapnik, 0, 16, 256, ".png", "");

Note the "16" - that is where you specify the max zoom level.

But really, you should create your own concrete class and extend BitmapTileSourceBase. It sounds like you are using static imagery and not online imagery which is what XYTileSource is for.

Kalvin answered 22/7, 2011 at 17:27 Comment(2)
Yea, I am using downloaded map tilesBelak
kurtzmarc, can you be a little more specific with this answer?Casino
F
2

You can use the mapView.setMinZoomLevel()and mapView.setMaxZoomLevel() methods to adjust the zoom level.

Felipafelipe answered 9/11, 2015 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.