Other functions

In this section, we are going to learn about some other functions that may be useful at times. They are:

  • Orientation to point
  • Point to orientation
  • Getting the location

Orientation to point

This helps us convert the screen orientation into point coordinates in screen pixels. This can be done by calling the orientationToPoint() method on the StreetViewPanorama object. It takes the StreetViewPanoramaOrientation object as a parameter. Take a look at the following code in the callback method:

 @Override public void onStreetViewPanoramaReady(final StreetViewPanorama panorama) { panorama.setPosition(AGRA); panorama.setOnStreetViewPanoramaClickListener(new StreetViewPanorama.OnStreetViewPanoramaClickListener() { @Override public void onStreetViewPanoramaClick(StreetViewPanoramaOrientation ...

Get Learning Android Google Maps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.