title: Animate hundreds of markers with Google Map on Android
body: <p>I have more then 300 markers on top of Google Map in my Android project. They are vehicles in San Francisco as you can see from the screenshot.
  I have direction and speed of the vehicles and I want to animate them for 10 seconds before the next call to the API.</p>
  
  <p>To animate one marker I use this code:</p>
  
  <pre><code>static void animateMarkerToICS(Marker marker, LatLng finalPosition, final LatLngInterpolator latLngInterpolator) {
      TypeEvaluator&lt;LatLng&gt; typeEvaluator = new TypeEvaluator&lt;LatLng&gt;() {
          @Override
          public LatLng evaluate(float fraction, LatLng startValue, LatLng endValue) {
              return latLngInterpolator.interpolate(fraction, startValue, endValue);
          }
      };
      Property&lt;Marker, LatLng&gt; property = Property.of(Marker.class, LatLng.class, "position");
      ObjectAnimator animator = ObjectAnimator.ofObject(marker, property, typeEvaluator, finalPosition);
  
      animator.setInterpolator(new LinearInterpolator());
  
      animator.setDuration(ANIMATION_MILLIS);
      animator.start();
  }
  </code></pre>
  
  <p>When I call this for all 300 marker the map is, as expected, slow and not very responsive.</p>
  
  <p>The question is, what is the best way to animate 300 markers at the same time?
  Is there an efficient way to achieve good performance for this task?</p>
  
  <p>(I'm using Google Maps v2 on Android > 4.0)</p>
  
  <p>p.s. I'm not planning to run the animation when the map if fully zoomed out so probably I will never have all 300 markers moving at the same time but still I would like to have feedback about the best way to work on this problem. Thanks!</p>
  
  <p><img src="https://i.stack.imgur.com/jQVs4.png" alt="enter image description here"></p>