【发布时间】:2014-08-04 00:11:16
【问题描述】:
您好,我正在制作离线地图。 我看不到从 Mobile Atlas Creator 创建的地图图块。我正在使用 MapQuest 和 Tiel 格式 PNG,它没有显示任何问题并正确生成 .APK 我都试过了
- 我将 .zip 文件放在 /sdcard/osmdroid/ 中
- 我通过 MapquestOSM 更改了 .zip MapQuest 中的第一个文件夹
- 我查看了我的 GeoPoint 但是对我没有任何作用...
我的库是下一个...
- android-support-v4.jar
- osmdroid-android-3.0.7.jar
- osmdroid-android-3.0.7-javadoc.jar -slf4j-android-1.5.8.jar
我的来源是: MainActivity.java
package com.example.mapasasmdroid;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapView mapView = new MapView(this, 256); //constructor
mapView.setClickable(true);
mapView.setBuiltInZoomControls(true);
setContentView(mapView); //displaying the MapView
mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
mapView.getController().setZoom(15); //set initial zoom-level, depends on your need
mapView.getController().setCenter(new GeoPoint(-16,528484,-68.109397));
//mapView.getController().setCenter(new GeoPoint(,));
mapView.setUseDataConnection(true);
mapView.setMultiTouchControls(true);
}
}
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapasasmdroid"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
请帮帮我!!我真的很需要这个...
【问题讨论】: