Book Image

Learning Android Google Maps

Book Image

Learning Android Google Maps

Overview of this book

This book helps you to overcome the most common problems faced by users and helps you create a successful map application without any hassle. The book starts with a brief description of how to set up an environment and obtain an API key to create your map application. This book will teach you about adding markers, overlays, and information windows to the map in detail. You will then dive deep into customizing various types of maps and working with location data and Google Street view. By the end of this book, you will be able to create succinct map applications in Android using Google maps efficiently.
Table of Contents (18 chapters)
Learning Android Google Maps
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

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 streetViewPanoramaOrientation) {
                Point point = panorama.orientationToPoint(streetViewPanoramaOrientation);
                Log.d("Orientation...