Android OSM droid - set the level of Max Zoom

I am using App vith using osmdroid mapView. We have maps with a maximum zoom level of 16, but Android allows us to have 18 zoom levels. Do you know how to set the maximum zoom level to 16 instead of the standard 18?

thanks

Khmyzak

+6
source share
2 answers

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

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

Original answer:

Create your own TileSource class and use it. You can piggyback on one of the source classes for the tile, for example:

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

Pay attention to "16" - here you specify the maximum zoom level.

But actually you have to create your own concrete class and extend BitmapTileSourceBase. It looks like you are using static images, not the online images that XYTileSource is for.

+7
source

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

+1
source

Source: https://habr.com/ru/post/893246/


All Articles