我建议保存第一个获取馈送到CustomLocationOverlay中drawMyLocation函数的地址点,并使用它代替馈送给该函数的myLocation。
int intFirstGeoPoint = 0;
GeoPoint FirstGeoPoint;
protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) {
if(intFirstGeoPoint == 0){
FirstGeoPoint=myLocation;
intFirstGeoPoint=1;
}else{
myLocation=FirstGeoPoint;
}
// translate the GeoPoint to screen pixels
Point screenPts = mapView.getProjection().toPixels(myLocation, null);
...
...
你也可以抓住这个位置,并创建一个新的DrawableMapOverlay只绘制了这一点,而不是霸王硬上弓LocationOverlay
你应该做的另一个问题。但是,是的。使用相同的FirstGeoPoint,在那一点做一个canvas.drawText(),并加上一些偏移量。如果你提出另一个问题,我会提供更多细节 – greekygyro