清空OsmDroid地图?凡定制的新地图? [英] Empty OsmDroid Map? Where to custom the new map?
问题描述
最近,我试图按照这些步骤:网站
与添加在地图上的休闲方式可见到屏幕
使用这种code:
with the casual way of adding the map to be visible into the screen using this code:
GPSTrackerActivity.java
public class GPSTrackerActivity extends Activity {
private SDCardHandler SDTool;
private ToastSender ToastObject;
private FrameLayout frm_lay;
private MapView myOpenMapView;
private MapController myMapController;
@Override
protected void onCreate(Bundle in) {
super.onCreate(in);
setContentView(R.layout.activity_gpstracker);
SDTool = new SDCardHandler();
ToastObject = new ToastSender(this);
frm_lay = (FrameLayout) findViewById(R.id.frm_lay);
myOpenMapView = (MapView) findViewById(R.id.openmapview);
myOpenMapView.setBuiltInZoomControls(true);
myMapController = myOpenMapView.getController();
myMapController.setZoom(4);
}}
而这其中,
activity_gpstracker.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_title"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/default_color" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_desc"
android:textColor="@color/default_color" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_livtr"
android:textColor="@color/default_color" />
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
</TableLayout>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_curloc"
android:textColor="@color/default_color" />
<FrameLayout
android:id="@+id/frm_lay"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<org.osmdroid.views.MapView
android:id="@+id/openmapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_latitude"
android:textColor="@color/default_color" />
<EditText
android:id="@+id/txt_latitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_longtitude"
android:textColor="@color/default_color" />
<EditText
android:id="@+id/txt_longtitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
</TableRow>
<TableRow
android:id="@+id/tableRow5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_altitude"
android:textColor="@color/default_color" />
<EditText
android:id="@+id/txt_altitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text" />
</TableRow>
</TableLayout>
</LinearLayout>
但遗憾的是,code以上,似乎给我什么。
所有组件都似乎除了地图视图正常,似乎也没有什么(空)。
我发现noway哪里定制我自己的地图地图进去。任何线索?
but unfortunately, the code above seems giving me nothing. All components seems normal except the map view, it appeared to be nothing (empty). And i found noway where to custom the map of my own map into it. Any clues?
推荐答案
您不跟随你提到的教程。
按照它启动,并有它的工作。然后,你可以引入变化。
You don't follow the tutorial you mention. Start by following it, and have it working. Then you can introduce changes.
我发现noway哪里定制我自己的地图到它的地图。=>这是一个明显的问题,所以创建一个单独的问题。如果你想要一个答案,有太大的(多)更清楚你想要什么。
"And i found noway where to custom the map of my own map into it. " => this is a distinct issue, so create a separate question. And if you want an answer, be much (much) more clear about what you want.
这篇关于清空OsmDroid地图?凡定制的新地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!