Open GoogleCodeExporter opened 8 years ago
This is an interesting problem. It sounds like you are adjusting the maps so
that they always face north, correct? So as I turn around the maps turn with
me. This would make a great sample for the demo app.
Try turning off SafeDraw and see if that helps. I would leave hardware
acceleration off too for testing. It does sound like a rounding error (which
the SafeDraw essentially aims to fix) but it could be something else.
Original comment by kurtzm...@gmail.com
on 1 Jun 2013 at 4:40
Yes, the idea is that the map turns as the user rotates and it works and looks
great (the speed of the Nexus makes for a great experience).
However, the illusion of smoothness gets completely ruined by the jerkiness.
Turning off SafeCanvas doesn't help. It actually makes things worse, as there
are black lines between the tiles and all the tiles start to shake
independently.
Hardware acceleration doesn't make a difference either, except the performance
penalty when it's off.
As for the demo app sample, I can write one up once this is done, as the
concept is pretty straightforward - you register your Activity as a
SensorEventListener and simply pass the bearing received in onSensorChanged to
the MapView.
I can't say I have an idea of where to look next. The issue isn't in the
rotation of the canvas. It isn't in the overlays and it isn't in GeometryMath.
I don't think it's in the Projection class either, as the values used in
dispatchDraw are pretty much constant.
Original comment by RandomA...@gmail.com
on 1 Jun 2013 at 4:50
Hi,
Just a thought..
Is the compass sensor of your device working normally?
Only the map rotates abnormally or also the compass drawable is jumping to
random orientations?
You can check this also by trying device's compass / map rotation with another
map application e.g. Google Maps.
Because I have been seen devices where their compass / map was rotating
randomly and the reason was that the sensor was sending wrong values all the
time. Probably a compass calibration could help if this is the case.
Regards.
Original comment by devemu...@gmail.com
on 1 Jun 2013 at 8:02
[deleted comment]
The app has been tested on around a dozen devices and they all exhibit the same
behavior, so I don't think it's a compass issue. Although I use
SENSOR_DELAY_FASTEST, filtering the input by trimming the decimal part will
make the map less prone to random shake. However, when rotating it, the skips
are noticeable.
Attached is a simple Activity which will reproduce the error. Keep in mind that
the default tile provider doesn't support high zoom levels so the issue might
not be obvious. However, if you pay close attention to the map at the highest
zoom, you will notice that it is shaking.
I added a "toggle filter" button which will strip the decimal part from the
orientation. When this is enabled, rotating the device will show that the pivot
changes slightly when rotating.
Here is a video showing the issue in my app at zoom level 19 (much more
obvious):
http://www.youtube.com/watch?v=8qqhqAdqrIg
The device and the camera weren't moved at all.
Original comment by RandomA...@gmail.com
on 1 Jun 2013 at 4:09
Attachments:
Can you update to the latest trunk and try it again? I made a change that may
help this issue.
Original comment by kurtzm...@gmail.com
on 11 Jun 2013 at 2:19
Tried it out. The issue is still there, though the pattern seems to have
changed.
Original comment by RandomA...@gmail.com
on 11 Jun 2013 at 3:48
Have the same problem with MyLocationNewOverlay at 21-22 zoom level. The person
on map snakes even when i simply move map at any direction.
If I change canvas.drawBitmap(mPersonBitmap, mDirectionRotater, mPaint) to
canvas.drawBitmap(mPersonBitmap, x, y, mPaint) then snaking stops.
Looks like sMatrix.postTranslate(xOffset, yOffset) does not work there because
of insufficient precision of float matrices.
Original comment by ls.illar...@gmail.com
on 29 Jun 2013 at 6:43
We need to stop using the matrix and let the safe canvas handle the
translation, rotation and scaling since it does it correctly.
Original comment by kurtzm...@gmail.com
on 12 Jul 2013 at 8:35
This issue was updated by revision r1252.
Use safe canvas to do all translation, rotation and scaling rather than the
matrix. Fixes issues with shaking at high levels.
Fix rotation method in SafeTranslatedCanvas to do it in a "safe" way.
Update issue 447
Prevent location icon from scaling incorrectly with rotation.
Original comment by kurtzm...@gmail.com
on 12 Jul 2013 at 8:37
Please test and report back!
Original comment by kurtzm...@gmail.com
on 12 Jul 2013 at 8:38
Issue still (r1254) seems to persist in my project with the same symptoms -
when rotation is enabled, the map shakes at high zoom levels. Might be worth
mentioning that the whole canvas seems to translate, not just the overlays.
Not sure if the pattern of the shaking has changed, though.
Also, if it was fixed in an another component, shouldn't the changes in r1241
eventually be reverted?
Original comment by RandomA...@gmail.com
on 17 Jul 2013 at 12:57
Okay will look into this again and try to reproduce.
Original comment by kurtzm...@gmail.com
on 17 Jul 2013 at 12:21
So the issue is that in MapView.dispatchDraw() where the rotation is applied it
is using a rotate() method that takes floats. Maybe we have to re-apply
rotation in the SafeDrawOverlay?
Original comment by kurtzm...@gmail.com
on 18 Jul 2013 at 6:37
This issue was updated by revision r1255.
Since unsafe canvas rotation occurs in MapView, then in SafeDrawOverlay we have
to unsafely un-rotate the canvas, and then re-rotate using the safe canvas.
This should fix map shaking at high zoom levels with rotation.
Original comment by kurtzm...@gmail.com
on 18 Jul 2013 at 7:20
Try it again and let me know what results you get. I can't tell if it's fixed
or just not as bad.
Original comment by kurtzm...@gmail.com
on 18 Jul 2013 at 7:21
The changes in r1241 fix shaking in the maps without rotation at high zoom
levels. That fix is still necessary and is separate from this issue.
Original comment by kurtzm...@gmail.com
on 18 Jul 2013 at 7:22
Looks much better now (doesn't shake randomly when standing still), but the
pivot still changes slightly depending on angle.
My guess is that the center of the map gets determined wrong, as all elements
get offset for the same amount.
Original comment by RandomA...@gmail.com
on 19 Jul 2013 at 11:36
Hello!
I have same problems in my application. I use the RotationGestureOverlay from
sample project.
If I rotate map with two fingers and then stop fingers - the map starts shaking
on every zoomlevel.
I'm using the latest trunk snapshot.
Original comment by yuri.den...@gmail.com
on 1 Nov 2013 at 5:42
Original issue reported on code.google.com by
RandomA...@gmail.com
on 1 Jun 2013 at 3:53