Home » Android » How to show tilt map in Android?

How to show tilt map in Android?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am developing an Android application with google maps.

Displaying maps in android I followed the Android documentation. I successfully got the mapview in my application. But I need to show the map in Tilt view. I did not find any map example using “Tilt view“. Please suggest how to get the tilt view in Android.

I added an image of the tilt view map. left side map is normal to view right-side map is tilt view.enter image description here

How to&Answers:

https://developers.google.com/maps/documentation/android/views?hl=en

CameraPosition cameraPosition = new CameraPosition.Builder().
                    target(YourLocationPoint).
                    tilt(60).
                    zoom(15).
                    bearing(0).
                    build();

myMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

Answer:

You don’t need to write any code just write one line in your xml part(activitymap.xml)

map:cameraTilt="60"

adjust the value by your own wish

Answer:

That’s not available in the Google Maps APIs yet.

The best you can do is use an intent to start the Google Maps app itself but I don’t know if you can ask for a tilt through it.