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

Searching for a location


In the previous section, we displayed a location on the map using its coordinates. Now, let's discuss how to search for and display a location using a string query. It can be done in the following ways:

  • geo:latitude,longitude?q=my+street+address

  • geo:0,0?q=my+street+address

  • geo:0,0?q=latitude,longitude(label)

For zoom, we use the z parameter. Here, we used q as the parameter. In the second and third way, we used 0,0 as the latitude and longitude and passed the query. The map takes the coordinates 0,0 as the base and begins its search. There may be situations where the same address may exist in many places all over the world. To prevent this confusion, we use the latitude and longitude as a specified value instead of 0,0. So, it looks for the address near the coordinates.

The street name should be separated by +.

The q parameter defines the location to be highlighted in the map. Some places in the map are identified by a label. In these situations, we can use the label to...