Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网}
}
catch (Exception e)
{
e.printStackTrace();
}
return gp;
}
/**
* 更新MapView地图
* @param gp GeoPoint地理坐标对象
* @param mv 查询的数据的字段名称
* @param zoomLevel 放大层级
* @param setSatellite 是否显示卫星地图
*/
public static void refreshMapViewByGeoPoint
(GeoPoint gp, MapView mv, int zoomLevel, boolean setSatellite)
{
try
{
mv.displayZoomControls(true);
MapController mc = mv.getController();
mc.animateTo(gp);
mc.setZoom(zoomLevel);
mv.setSatellite(setSatellite);
}
catch(Exception e)
{
e.printStackTrace();
}
}
/**
* 在地图上显示Overlay图片
* @param gp GeoPoint地理坐标对象
*/
private void showImageOverlay(GeoPoint gp)
{
/* 设置Overlay */
GeoPointImageOverlay mLocationOverlay01;
mLocationOverlay01 = new GeoPointImageOverlay
(
gp,
R.drawable.hipposmall
);
List overlays = mMapView01.getOverlays();
overlays.add(mLocationOverlay01);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
package irdc.ex10_06;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import android.database.Cursor;
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;
更多精彩
赞助商链接