2011-09-06 53 views

回答

1

你需要通過緯度/經度對MapActivity類,然後被置到的GeoPoint對象。此外,您還將疊加層(第一次在地圖上顯示圖釘時添加一次)添加到地圖中,並且在疊加層實施的該類中,您必須繪製針點並將該GeoPoint對象傳遞到該地圖中,並將該GeoPoint對象傳遞給該地圖

private void drawFreeMarker(Canvas canvas, MapView mapView, boolean shadow) { 
      Point screenPts = new Point(); 
      mapView.getProjection().toPixels(tempPoint, screenPts); 
      //---add the marker--- 
      Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.bluepin_38); 
      canvas.drawBitmap(bmp, screenPts.x, screenPts.y, null); 
     } 

這裏我實現像這樣在我的應用程序tempPoint是是GeoPoint的包含緯度/經度值,當位置變化,你必須傳遞價值的MapActivity和無效的地圖,這是可以移動的方式你銷

0

你需要onLocationChange從MapView的previus覆蓋刪除和第二帶標記添加...我相信你正在使用MyLocationOverlay類????

相關問題