我建議保存第一個獲取饋送到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