{"action":"created","issue":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/289","labels_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/289/comments","events_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/289/events","html_url":"https://github.com/OneBusAway/onebusaway-android/issues/289","id":104093063,"number":289,"title":"Jumping markers on Maps v2","user":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/milestones/1","html_url":"https://github.com/OneBusAway/onebusaway-android/milestones/Public%20v2.0.x%20release","labels_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/milestones/1/labels","id":1322936,"number":1,"title":"Public v2.0.x release","description":"A public release of version v2.0.x, which is currently available to the alpha testers.","creator":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":28,"state":"open","created_at":"2015-09-24T21:47:47Z","updated_at":"2015-10-29T23:35:56Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-08-31T17:11:54Z","updated_at":"2015-10-29T23:38:15Z","closed_at":null,"body":"*For `develop` branch*\r\n\r\nI'm seeing markers jump around on the map on Android Maps API v2 even when nothing is happening in the app.  \r\n\r\nHere's a video of the behavior:\r\n\r\nhttps://youtu.be/cOUGD0T5Ojs\r\n\r\n*What I expect* \r\n\r\nMarkers should remain stationary at their originally added lat/long.\r\n\r\n*What steps will reproduce the problem?* \r\n\r\n* 1a. Download the APK from:\r\nhttps://dl.dropboxusercontent.com/u/46443835/OneBusAway/UI_redesign/onebusaway-android-oba-google-debug.apk\r\n\r\nor\r\n\r\n* 1b. Build, install, and run the develop branch of OneBusAway:\r\n * a. `git clone https://github.com/OneBusAway/onebusaway-android.git`\r\n * b. `git checkout develop`\r\n * c. `gradlew installObaGoogleDebug`\r\n * d. `adb shell am start -n com.joulespersecond.seattlebusbot/org.onebusaway.android.ui.HomeActivity`\r\n\r\n* 2. Browse to any supported city (e.g., Seattle or Tampa), and watch the green bus stop markers jump around on the map\r\n\r\nI should add that I can't *always* reproduce this.  It seems like everything works fine for a time, but then when the markers start jumping around they don't stop.\r\n\r\n*Marker Implementation Details*\r\n\r\nThe code that loads the icons used for the 9 marker types (8 directions + no direction) is here:\r\nhttps://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/google/java/org/onebusaway/android/map/googlemapsv2/StopOverlay.java#L169\r\n\r\nI'm using this drawable:\r\nhttps://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/main/res/drawable/map_stop_icon.xml\r\n\r\n...which is a number of shapes - this creates the main green circle with the white outline and the drop shadoes.  Then, I'm drawing the direction arrow on top of this drawable for each of the 8 directions - code for drawing directions is here:\r\n\r\nhttps://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/google/java/org/onebusaway/android/map/googlemapsv2/StopOverlay.java#L202\r\n\r\nIn the code to load the icons, I'm caching the `BitmapDescriptor` returned from `BitmapDescriptorFactory.fromBitmap()` for each of the 9 icon types on first load, so this isn't done each time a marker is put on the map.\r\n\r\nI also saw the app crash to \"Unfortunately, OneBusAway has stopped.\" and saw this exception in Logcat after letting the app sit on the map screen for a few minutes:\r\n\r\n    08-10 16:40:02.422  15843-15929/com.joulespersecond.seattlebusbot E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 8614\r\n        Process: com.joulespersecond.seattlebusbot, PID: 15843\r\n        java.lang.IllegalArgumentException: Comparison method violates its general contract!\r\n                at java.util.ComparableTimSort.mergeHi(ComparableTimSort.java:831)\r\n                at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:449)\r\n                at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:372)\r\n                at java.util.ComparableTimSort.sort(ComparableTimSort.java:178)\r\n                at java.util.ComparableTimSort.sort(ComparableTimSort.java:142)\r\n                at java.util.Arrays.sort(Arrays.java:1957)\r\n                at java.util.Collections.sort(Collections.java:1864)\r\n                at com.google.maps.api.android.lib6.gmm6.n.bl.a(Unknown Source)\r\n                at com.google.maps.api.android.lib6.gmm6.n.l.a(Unknown Source)\r\n                at com.google.maps.api.android.lib6.gmm6.n.l.b(Unknown Source)\r\n                at com.google.maps.api.android.lib6.gmm6.n.cv.f(Unknown Source)\r\n                at com.google.maps.api.android.lib6.gmm6.n.cv.run(Unknown Source)\r\n\r\nI've seen this on an LG G4 and Nexus 6.  More details on LG device is below.\r\n\r\n* LG G4 LS991 with Android 5.1 (LS991ZV4)\r\n\r\n* Google Play Services client library version = `compile 'com.google.android.gms:play-services-maps:7.5.0'` and `compile 'com.google.android.gms:play-services-maps:7.8.0'`\r\n\r\n* Google Play Services version on the device - Google Play Services 7.8.99 (2134222-440)\r\n\r\n* Android SDK Version: `compileSdkVersion 21 buildToolsVersion \"21.1.2\"`\r\n\r\nThis issue hasn't always existed, which makes me believe it was introduced during an update to Android Google Play Services/Maps at some point.\r\n\r\nI've opened an issue for this on gmaps-api-issues as well, but no response as of this post:\r\n\r\nhttps://code.google.com/p/gmaps-api-issues/issues/detail?id=8455\r\n\r\nI've created a smaller demo project here on Github that uses the same marker implementation:\r\n\r\nhttps://github.com/barbeau/maps-demo\r\n\r\n...but so far I haven't been able to reproduce the problem there."},"comment":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/comments/152357550","html_url":"https://github.com/OneBusAway/onebusaway-android/issues/289#issuecomment-152357550","issue_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/289","id":152357550,"user":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T23:38:15Z","updated_at":"2015-10-29T23:38:15Z","body":"Interestingly, if you start with the arrival screen in landscape mode, and then tap on \"Show route on map\" so this map screen loads in landscape, the markers don't jump around.  And, if you switch to portrait while on that screen, the markers also don't jump around.  But, if you change the orientation back to landscape, then the markers start jumping.  So the orientation change from portrait to landscape while viewing the route mode on map seems to trigger the jumping."}}