O'Reilly logo

Learning Android Google Maps by Raj Amal W.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with shapes

Google Maps for Android allows us to add custom shapes in our map application. The three ways supported are as follows:

  • Polyline
  • Polygon
  • Circle

Let's understand these methods now.

Polyline

Polyline is a set of points where line segments are drawn between consecutive points. For example, you can give a set of latitude, longitude coordinates as input, and lines are drawn connecting these points.

The following image is an example of a polyline that connects two points:

Polyline

The Polyline object consists of a set of latitude, longitude coordinates and it connects the points to each other.

Creating a polyline

A polyline can be created using a PolylineOptions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required