New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jumping markers on Maps v2 #289
Comments
I've also posted to StackOverflow on this problem: There have been a few upvotes so far, so I guess we're not the only ones seeing this. |
* Resources.getDrawable() is deprecated starting with API Level 22 * See http://stackoverflow.com/questions/29041027/android-getresources-getdrawable-deprecated-api-22 * This could potentially be related to #289 - maybe this fixes it?
And a post to the Google+ Android Developers community: |
I just pushed 01b35e9 to the @cagryInside could you start running this on your Nexus 6 and let me know if you see the problem again? I can't always consistently reproduce this on the LG G4, as its intermittent. So, I can't really saw whether or not this commit conclusively fixed the problem yet, unless neither of us see the issue again after a period of time. |
I'm still seeing the problem, so looks like switching from caching |
@barbeau Just checked with my nexus 6, I don't see the problem. But, I rolled back the latest development, I still don't see the problem. So, I don't think it did any effect. |
Yeah, this one has been tricky to reproduce. After doing a new debug install it doesn't always happen right away. Seems like after a while something breaks in the Maps API implementation, and after this happens then the jumping markers persist for a while. It also seems to happen per-app - last night I saw the issue in OBA, and switched to the maps-demo project I created, but didn't see the issue in that app. |
I haven't seen this issue lately, and I noticed that Google Play services on my device was bumped to 8.1.15. So, maybe it was fixed with an update of Google Play services? @cagryInside (or anyone else) - if you see this problem again, please let me know, and let me know which version of Google Play services your device has. |
Talking to @cagryInside today, he hasn't seen this on his Nexus 6 recently either - currently running Play Services 8.1.15. I'm going to close this for now, and will re-open if we see the problem again. |
Just saw this again - I think it may be triggered by stacking multiple Activities that use the map on top of each other, and then closing them by hiting the back button. There is a new version of Play Services available in the build tools, we should try this. |
I'm still seeing this after bumping Play Services to 8.1.0 in build.gradle. It's more subtle than its been in the past - sometimes the shift of the markers is just changes in the Z-order, with the position unchanged. But, jumping of markers to places where there shouldn't be markers can still be seen. |
For the current Strangely, if you return back to portrait orientation, the jumping stops, and everything goes back to normal. This is still using Play Services to |
Interestingly, if you start with the arrival screen in landscape mode, and then tap on "Show route on map" so this route mode 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, but never landscape to portrait. |
Play Services 8.3 was released today, so just bumped Play Services to |
AFAIK there isn't anything we can do to prevent this issue - it just happens. So, I'm going to leave it open but push it to a future milestone. Under normal use/conditions it doesn't seem bad/frequent enough to block a public v2.0 release. But, we should continue to track it. |
Whoops, this was automatically close by Github in the merge to master. |
This issue may have been fixed by 1fe8756, which fixed a leak of the From my SO post (http://stackoverflow.com/a/34227146/937715):
https://github.com/CUTR-at-USF/onebusaway-android/tree/jumpingMarkersTest
I'm going to close this for now, and will re-open if I see it again. |
For
develop
branchI'm seeing markers jump around on the map on Android Maps API v2 even when nothing is happening in the app.
Here's a video of the behavior:
https://youtu.be/cOUGD0T5Ojs
What I expect
Markers should remain stationary at their originally added lat/long.
What steps will reproduce the problem?
https://dl.dropboxusercontent.com/u/46443835/OneBusAway/UI_redesign/onebusaway-android-oba-google-debug.apk
or
git clone https://github.com/OneBusAway/onebusaway-android.git
git checkout develop
gradlew installObaGoogleDebug
adb shell am start -n com.joulespersecond.seattlebusbot/org.onebusaway.android.ui.HomeActivity
I 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.
Marker Implementation Details
The code that loads the icons used for the 9 marker types (8 directions + no direction) is here:
https://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/google/java/org/onebusaway/android/map/googlemapsv2/StopOverlay.java#L169
I'm using this drawable:
https://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/main/res/drawable/map_stop_icon.xml
...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:
https://github.com/OneBusAway/onebusaway-android/blob/develop/onebusaway-android/src/google/java/org/onebusaway/android/map/googlemapsv2/StopOverlay.java#L202
In the code to load the icons, I'm caching the
BitmapDescriptor
returned fromBitmapDescriptorFactory.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.I 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:
I've seen this on an LG G4 and Nexus 6. More details on LG device is below.
compile 'com.google.android.gms:play-services-maps:7.5.0'
andcompile 'com.google.android.gms:play-services-maps:7.8.0'
compileSdkVersion 21 buildToolsVersion "21.1.2"
This issue hasn't always existed, which makes me believe it was introduced during an update to Android Google Play Services/Maps at some point.
I've opened an issue for this on gmaps-api-issues as well, but no response as of this post:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=8455
I've created a smaller demo project here on Github that uses the same marker implementation:
https://github.com/barbeau/maps-demo
...but so far I haven't been able to reproduce the problem there.
The text was updated successfully, but these errors were encountered: