Android的OSM机器人 - 设置最大缩放级别 [英] Android OSM droid - set Max Zoom level
问题描述
我在执行osmdroid MapView类的应用程序圣维特使用。我们的地图,最大16缩放级别,而Android可以让我们有18个缩放级别。你知道如何设置最大变焦等级16,而不是默认的18?
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?
感谢
Hmyzak
推荐答案
更新的 - 我们增加了简单的setMin / MaxZoomLevel()方法在树干图形页面。它应包括在3.0.10
Update - we have added simple setMin/MaxZoomLevel() methods to MapView in the trunk. It should be included in 3.0.10.
请参阅的https://$c$c.google .COM / P / osmdroid /问题/详细信息?ID = 418 ,了解更多信息。
See https://code.google.com/p/osmdroid/issues/detail?id=418 for additional info.
原来的答复:
创建自己的TileSource类,并使用它。您可以搭载在混凝土瓦源类之一,如:
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", "");
请注意16 - 这是您指定的最大缩放级别
Note the "16" - that is where you specify the max zoom level.
不过说真的,你应该创建自己的具体类和扩展BitmapTileSourceBase。这听起来像你正在使用的静态图像,而不是网上的图像是什么XYTileSource是。
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.
这篇关于Android的OSM机器人 - 设置最大缩放级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!