| Issue 5881: | Rotation and tilt do not take padding into account | |
| 26 people starred this issue and may be notified of changes. | Back to list |
Changing bearing and tilt of the Camera position is not relative to the padded region but is relative to the center of the entire container: CameraPosition pos = new CameraPosition(new LatLng(location.getLatitude(), location.getLongitude()), zoom, Tilt, Bearing); mMap.animateCamera(CameraUpdateFactory.newCameraPosition(pos)); Changing LatLng Works fine: CameraUpdate camUpdate = CameraUpdateFactory.newLatLng( new LatLng(location.getLatitude(), location.getLongitude())); mMap.animateCamera(camUpdate);
Apr 1, 2014
When will this issue be addressed? We can not release our app until the problem is resolved
Nov 7, 2015
I can confirm this issue is not 100% solved. It still is not centered relative to the padded region (although it is not centereed relative to the center of the entire container either). Happens when changing bearing, frequently but not always. Tested on Android 5.0 and 4.4.2 and last Google Play services( 8.3.01) Any solution?
Nov 7, 2015
Two years after this bug has been confirmed still no solution. Can we get a time frame at least?
Nov 8, 2015
Google has a $70 billion cash hoard. Meanwhile, there are tens of thousands of developer-hours of unpaid technical debt in Android. They need to hire some experienced bug-fixers and put them to work on the issue backlog before some competitor comes out with a mobile platform that runs on existing Android hardware and hordes of disgruntled developers jump like rats from a sinking ship.
Mar 13, 2016
Is there any workaround for this problem ? I need to rotate (change bearing) the map around some point other than the map center. In my navigation application a car marker that is located at the bottom of the map has to keep direction according the gps bearing, so I need to rotate the map around the car marker. How can it be accomplished ?
Mar 13, 2016
Issue 5961 has been merged into this issue.
Mar 15, 2016
Please Google a solution or a workaround The bug was confirmed 2.5 years ago!!
Mar 23, 2016
23mar2016 and this is still not resolved. Guys, its floating point math rounding problem. Its not rocket science to fix it - but we can't fix it out here: Google needs to fix this in the map component. Its probably the same issue causing the 'drift' if your code changes the bearing of the camera to correlate to the compass sensor. IE: If your tablet changes bearing from north to west and you trying to change the map bearing so it corresponds keeping 'up' in the same direction as you are traveling then your location drifts up and left by about 10 meters.
May 7, 2016
It's much bigger than a rounding error.
Sep 13, 2016
Any known workaround for this?
Dec 12, 2016
Issue 11054 has been merged into this issue.
Dec 12, 2016
Any news on fixing this issue?
Dec 13, 2016
This issue doesn't even have an owner. What is going on at Google?
Dec 13, 2016
Our app depends on this feature, we can't release it without this resolved, we had to put some projects on hold in hope for this to be fixed soon and it's been 3 years since its report. Please advise.
Dec 15, 2016
If you have same special conditions like we are, specifically, placing car marker near bottom of a screen (centered horizontally but not vertical), we implemented next solution: We increased mapView height to make it bigger then screen height and use scrollY to simulate placing car marker where we need vertically (center in 2D mode and in last third of a screen in 3D). Animation works smooth and user can't notice anything strange. I don't call it a solution, it's a hack, but Google didn't left a better option.
Dec 15, 2016
Right, thanks for noticing. We added logo manually.
Dec 15, 2016
Thanks for the tip. I was able to make it work, but as you said, it's a hack, still not noticeable. Very simple to implement actually:
1) DON'T call the GoogleMap.setPadding(...), leave the paddings at 0s and the center in the center.
2) Create a CustomMapView class that extends MapView and then override the onMeasure method like this(If you're using SupportMapFragment just use a normal Fragment and inflate a layout that contains MapView):
/*
* The ratio is multiplied by the actual height to stretch the MapView towards the bottom thus making the center move towards the bottom, 4/3 the actual size is a perfect value for navigation view.
*/
private static final float RATIO = 4.f/3.f;
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int newHeight = (int) (MeasureSpec.getSize(heightMeasureSpec) * RATIO);
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY));
}
3) Done. (See image attached for visual explanation)
Issues:
1) According to the terms of use of Google Maps API for Android, the Google logo needs to be visible, in this case, stretching the height will put the logo below the bottom of the screen thus making it not visible, a workaround is to create an ImageView with the logo manually and position it at the bottom left.
2) GoogleMap.getProjection().getVisibleRegion() will not be a real region because 1/3 of the map is outside the screen and it is accounted as visible region as well.
3) This is still an issue an open issue that needs to be fixed by the Google Maps team because this is not the right way to do things.
I hope this helps.
Dec 27, 2016
setPadding is very useful, but this bug is really difficult to track down (I have assumed that I mis-used the API, as opposed to a Google bug.) This problem does not exist on iOS. Google: pls help fix Android implementation so we don't have to resort to a workaround. animateToBearing works beautifully with Insets (on iOS). [email protected]
Jan 17, 2017
Possibly related: issue 6567. |
|
| ► Sign in to add a comment |
Status: Confirmed
Labels: Internal-10846902