这是我的代码(如下),
如何删除地理点表单代码,并从服务器的sqlite中读取它?我有超过 1000 个地理点,所以我的代码太长了。
我已经创建了数据库,但不知道如何从服务器连接它。
public class SimpleMap extends MapActivity {
private MapView mapView;
List<Overlay> mapOverlays;
Drawable drawable;
Drawable drawable2;
MyLocationOverlay myLocationOverlay;
SimpleItemizedOverlay itemizedOverlay2;
SimpleItemizedOverlay itemizedOverlay;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
GeoPoint hr = new GeoPoint((int) (44.715513 * 1E6),
(int) (16.545410 * 1E6));
mapView.getController().animateTo(hr);
mapView.getController().setZoom(7);
mapOverlays = mapView.getOverlays();
myLocationOverlay = new FixedMyLocationOverlay(this, mapView);
mapView.getOverlays().add(myLocationOverlay);
mapView.postInvalidate();
drawable = getResources().getDrawable(R.drawable.icon2);
itemizedOverlay2 = new SimpleItemizedOverlay(drawable, mapView);
itemizedOverlay2.setShowClose(true);
itemizedOverlay2.setShowDisclosure(false);
itemizedOverlay2.setSnapToCenter(false);
GeoPoint point1000 = new GeoPoint((int) (34.109798 * 1E6),
(int) (25.242270 * 1E6));
OverlayItem overlayItem1000 = new OverlayItem(point1000,
"point1000", "some text");
itemizedOverlay2.addOverlay(overlayItem1000);
mapOverlays.add(itemizedOverlay2);