Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网(
gp,
R.drawable.hipposmall
);
List overlays = mMapView01.getOverlays();
overlays.add(mLocationOverlay01);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
5。工具方法:
Java代码
package irdc.ex10_06;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.location.Location;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.Projection;
public class GeoPointImageOverlay extends Overlay
{
private Location mLocation;
private int drawableID;
private double geoLatitude,geoLongitude;
/* 建构方法一,传入Location对象 */
public GeoPointImageOverlay(Location location, int drawableID)
{
this.mLocation = location;
this.drawableID = drawableID;
/* 取得Location的经纬度 */
this.geoLatitude = this.mLocation.getLatitude()*1E6;
this.geoLongitude = this.mLocation.getLongitude()*1E6;
}
public GeoPointImageOverlay
(Double geoLatitude, Double geoLongitude, int drawableID)
{
this.geoLatitude = geoLatitude*1E6;
this.geoLongitude = geoLongitude*1E6;
this.drawableID = drawableID;
}
public GeoPointImageOverlay(GeoPoint gp, int drawableID)
{
this.geoLatitude = gp.getLatitudeE6();
this.geoLongitude = gp.getLongitudeE6();
更多精彩
赞助商链接