Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some Google engineers have provided a nice demo video with some elegant sample code about how to animate markers from a starting point to an ending point, for all various versions of Android:</p> <p>The relevant code is here:</p> <p><a href="https://gist.github.com/broady/6314689" rel="noreferrer">https://gist.github.com/broady/6314689</a></p> <p>And a nice demo video of all of it in action.</p> <p><a href="http://youtu.be/WKfZsCKSXVQ" rel="noreferrer">http://youtu.be/WKfZsCKSXVQ</a></p> <p><strong>OLD DEPRECATED ANSWER BELOW</strong></p> <p>In the documentation, it is mentioned that Marker Icons cannot be changed:</p> <blockquote> <p><strong>Icon</strong></p> <p>A bitmap that's displayed for the marker. If the icon is left unset, a default icon is displayed. You can specify an alternative coloring of the default icon using defaultMarker(float). <strong>You can't change the icon once you've created the marker.</strong></p> </blockquote> <p><a href="http://developer.android.com/reference/com/google/android/gms/maps/model/Marker.html" rel="noreferrer">Google Maps API v2 Documentation</a></p> <p>You're going to have to keep track of specific markers, perhaps using a method similar to that described here: <a href="https://stackoverflow.com/questions/14310280/how-to-link-google-maps-android-api-v2-marker-to-an-object/14324081#14324081">Link a Marker to an Object</a>, then figure out which marker you need to update. Call <code>.remove()</code> on the marker, then create a rotated image depending on the "direction" you want, create a new Marker with that image, and add the new Marker to the map.</p> <p>You do not need to "clear" the map, simply remove the marker you want to modify, create a new one, then add it back to the map.</p> <p>Unfortunately, the new Maps API is not very flexible yet. Hopefully Google continues to improve upon it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload