我有一个 osmdroid 地图,我想从 MOBAC 的 osmdroid zip 或 gemf 文件加载离线图块。我查看了它,无论我走到哪里,它都说把它放在 sdcard/osmdroid 中。但它不起作用,我需要更改代码中的某些内容吗?
public class Map extends Activity {
private IMapView mMapView;
private static IMapController mMapController;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
mMapView = (MapView) findViewById(R.id.mapview);
((MapView) mMapView).setBuiltInZoomControls(true);
mMapController = mMapView.getController();
mMapController.setZoom(13);
GeoPoint geoPecs = new GeoPoint(46.070833,18.233056);
mMapController.setCenter(geoPecs);
mProvider = new MapTileProviderBasic(getApplicationContext());
mCustomTileSource = new XYTileSource("Turaterkep", null, 13, 15, 256, ".png", "http://users.atw.hu/perzsa/map/Turaterkep/");
mProvider.setTileSource(mCustomTileSource);
mTilesOverlay = new TilesOverlay(mProvider,this.getBaseContext());
mMapView.getOverlays().add(mTilesOverlay);
更新:我设法使用包含到 osmdroid 的示例从在线加载磁贴,我也更新了代码,我想我必须从这个示例开始,也许我可以从 localhost 加载?生病回来看看
图片:http: //i.stack.imgur.com/CoZT1.png