0
我有存儲在sqlite數據庫中的緯度和經度座標。我正在嘗試通過光標檢索這些文件,並將它們全部放在地圖上。我盡我所能,但我是新手,需要一點幫助。這是我到目前爲止有:當我進入我的GeoPoint靜態數字,如何添加存儲在SQLite中的地圖標記? - Android
public class allmapactivity extends MapActivity {
MapController mControl;
GeoPoint GeoP;
MapView mapV;
private SQLiteAdapter mySQLiteAdapter;
Cursor cursor;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mapV = (MapView) findViewById(R.id.mapview);
mapV.displayZoomControls(true);
mapV.setBuiltInZoomControls(true);
mapV.setSatellite(false);
List<Overlay> mapOverlays = mapV.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.pin);
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);
cursor = mySQLiteAdapter.queueAll5();
GeoPoint point = new GeoPoint((int) (Double.valueOf(SQLiteAdapter.KEY_CONTENT11) *1E6),(int) (Double.valueOf(SQLiteAdapter.KEY_CONTENT12) *1E6));
OverlayItem overlayitem = new OverlayItem(point, "Test", "Test");
itemizedoverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedoverlay);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
所有這些代碼的工作除了當我試圖從我的光標它強行關閉添加數據。任何幫助將是偉大的!