{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/4206","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/4206/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/4206/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/4206/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/4206","id":138703686,"number":4206,"title":"Add example using property animation","user":{"login":"tobrun","id":2151639,"avatar_url":"https://avatars.githubusercontent.com/u/2151639?v=3","gravatar_id":"","url":"https://api.github.com/users/tobrun","html_url":"https://github.com/tobrun","followers_url":"https://api.github.com/users/tobrun/followers","following_url":"https://api.github.com/users/tobrun/following{/other_user}","gists_url":"https://api.github.com/users/tobrun/gists{/gist_id}","starred_url":"https://api.github.com/users/tobrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobrun/subscriptions","organizations_url":"https://api.github.com/users/tobrun/orgs","repos_url":"https://api.github.com/users/tobrun/repos","events_url":"https://api.github.com/users/tobrun/events{/privacy}","received_events_url":"https://api.github.com/users/tobrun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/Android","name":"Android","color":"5319e7"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"tobrun","id":2151639,"avatar_url":"https://avatars.githubusercontent.com/u/2151639?v=3","gravatar_id":"","url":"https://api.github.com/users/tobrun","html_url":"https://github.com/tobrun","followers_url":"https://api.github.com/users/tobrun/followers","following_url":"https://api.github.com/users/tobrun/following{/other_user}","gists_url":"https://api.github.com/users/tobrun/gists{/gist_id}","starred_url":"https://api.github.com/users/tobrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobrun/subscriptions","organizations_url":"https://api.github.com/users/tobrun/orgs","repos_url":"https://api.github.com/users/tobrun/repos","events_url":"https://api.github.com/users/tobrun/events{/privacy}","received_events_url":"https://api.github.com/users/tobrun/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/26","html_url":"https://github.com/mapbox/mapbox-gl-native/milestones/android-v4.0.0","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/26/labels","id":1520788,"number":26,"title":"android-v4.0.0","description":"","creator":{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false},"open_issues":69,"closed_issues":201,"state":"open","created_at":"2016-01-19T23:39:55Z","updated_at":"2016-03-05T18:24:03Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-03-05T17:49:17Z","updated_at":"2016-03-05T21:21:30Z","closed_at":null,"body":"@cammace created an example of Marker animation using `Handler.postDelayed()`. While this works, this isn't the ideal implementation. This gave me the idea to use `PropertyAnimation` from the Android SDK.\r\n\r\nResult can be seen [here](https://youtu.be/0DyWmah7eQw).\r\n\r\nThe rough code for this is:\r\n\r\n```java\r\nLatLng brussels = new LatLng(50.900446, 4.485251);\r\nLatLng washington = new LatLng(38.897108, -77.036716);\r\n\r\nfinal Marker marker = mapboxMap.addMarker(new MarkerOptions().position(brussels));\r\nValueAnimator markerAnimator = ValueAnimator.ofObject(new TypeEvaluator<LatLng>() {\r\n\r\n     @Override\r\n      public LatLng evaluate(float fraction, LatLng startValue, LatLng endValue) {\r\n           return new LatLng(startValue.getLatitude() + (endValue.getLatitude() - startValue.getLatitude()) * fraction, startValue.getLongitude() + (endValue.getLongitude() - startValue.getLongitude()) * fraction);\r\n      }\r\n\r\n}, new LatLng[]{brussels, washington});\r\n\r\nmarkerAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\r\n        @Override\r\n        public void onAnimationUpdate(ValueAnimator animation) {\r\n                if (marker != null) {\r\n                     marker.setPosition((LatLng) animation.getAnimatedValue());\r\n                }\r\n        }\r\n});\r\n\r\nmarkerAnimator.setDuration(7500);\r\nmarkerAnimator.setRepeatCount(ValueAnimator.INFINITE);\r\nmarkerAnimator.setRepeatMode(ValueAnimator.REVERSE);\r\nmarkerAnimator.setInterpolator(new AccelerateDecelerateInterpolator());\r\nmarkerAnimator.start();\r\n```"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/192741891","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/4206#issuecomment-192741891","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/4206","id":192741891,"user":{"login":"cammace","id":5652865,"avatar_url":"https://avatars.githubusercontent.com/u/5652865?v=3","gravatar_id":"","url":"https://api.github.com/users/cammace","html_url":"https://github.com/cammace","followers_url":"https://api.github.com/users/cammace/followers","following_url":"https://api.github.com/users/cammace/following{/other_user}","gists_url":"https://api.github.com/users/cammace/gists{/gist_id}","starred_url":"https://api.github.com/users/cammace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cammace/subscriptions","organizations_url":"https://api.github.com/users/cammace/orgs","repos_url":"https://api.github.com/users/cammace/repos","events_url":"https://api.github.com/users/cammace/events{/privacy}","received_events_url":"https://api.github.com/users/cammace/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T21:21:30Z","updated_at":"2016-03-05T21:21:30Z","body":"That makes sense, i'll dig deeper in the code and check it out. "}}