public static final class

LatLngBounds.Builder

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.LatLngBounds.Builder

Class Overview

Class for building LatLngBounds objects. To create a LatLngBounds object, call include(LatLng) for each LatLng to include within the bounds, then call build().

Summary

Public Constructors
LatLngBounds.Builder()
Initializes an empty LatLngBounds.Builder.
Public Methods
LatLngBounds build()
Creates a new LatLngBounds object using the LatLng objects previously included with include(LatLng).
LatLngBounds.Builder include(LatLng point)
Adds the specified geographic point (LatLng) to the bounds.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LatLngBounds.Builder ()

Initializes an empty LatLngBounds.Builder.

Public Methods

public LatLngBounds build ()

Creates a new LatLngBounds object using the LatLng objects previously included with include(LatLng).

Returns
  • The new LatLngBounds object if include(LatLng) was called successfully at least once.
Throws
IllegalStateException if include(LatLng) was never called.

public LatLngBounds.Builder include (LatLng point)

Adds the specified geographic point (LatLng) to the bounds. This attempts to increase the bounds in a minimal way. That is, the method tries to increase the bounds both in eastward and westward directions and chooses the smaller of the two. If both directions result in bounds of same size, the bound is increased in the eastward direction. The bounds may cross the anti-meridian in the process.

After adding points to the bounds with this method, call build() to create the LatLngBounds.

Parameters
point A LatLng representing the geographic point to add to the bounds.
Returns
  • this LatLngBounds.Builder object with the point added.