2013-11-22 30 views
4

請有人可以幫我補充動畫標記這樣one Android的谷歌地圖V2Android的:如何添加動畫標記

謝謝。

+2

由於沒有明顯的「動畫標記」,也許您能解釋一下你所說的這個詞是什麼。 – CommonsWare

+0

我想在例子 – Abdel

+0

中添加這種類型的標記(.gif標記)嗨,我也面臨同樣的問題,如果你有溶劑請在這裏分享溶劑。謝謝 –

回答

-4

,請使用以下代碼來繪製

 BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.current_position_tennis_ball) 


     MarkerOptions markerOptions = new MarkerOptions().position(latLng) 
       .title("Current Location") 
       .snippet("Thinking of finding some thing...") 
       .icon(icon); 

     mMarker = googleMap.addMarker(markerOptions); 
+4

請隨時解釋這將如何實現任何形式的動畫效果。 – CommonsWare

+0

@CommonsWare你爲什麼認爲這不起作用?我沒有嘗試Prakash解決方案,但理論上你可以將它鏈接到可繪製的XML,其中有一組圖像顯示說每200毫秒..會不會動畫圖像? – Snake

+0

@Snake:你假設'BitmapDescriptor'能夠處理動畫,我假設它不是(如果是的話,他們會將它命名爲'DrawableDescriptor'而不是'BitmapDescriptor')。這就是爲什麼我向回答者建議解釋是有序的。 – CommonsWare

-1

設置標記也許你可能會得到的想法學習吧......

TranslateAnimation動畫=新TranslateAnimation(0.0F,400.0f,0.0 f,0.0f);
//新TranslateAnimation(xFrom,x要,yFrom,中國一拖)

animation.setDuration(2000); // animation duration 
animation.setRepeatCount(100); // animation repeat count (total repetition) 
animation.setRepeatMode(2); // repeat animation (left to right, right to left) 
//animation.setFillAfter(true);  

img_animation.startAnimation(animation);